aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
* avformat/evcdec: Avoid nonsense castsAndreas Rheinhardt2023-07-071-3/+3
| | | | | | | | | | | | | For uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE], &buf still points to the beginning of buf, but it is of type "pointer to array of EVC_NALU_LENGTH_PREFIX_SIZE uint8_t" (i.e. pointer arithmetic would operate on blocks of size EVC_NALU_LENGTH_PREFIX_SIZE). This is of course a different type than uint8_t*, which is why there have been casts in evc_read_packet(). But these are unnecessary if one justs removes the unnecessary address-of operator. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asfdec_f: fix need_parsing flag for codec mpeg4Zhao Zhili2023-07-041-1/+1
| | | | | | AVSTREAM_PARSE_FULL_ONCE is only implemented for H.264. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/asfdec_f: support bmp_tags_unofficialZhao Zhili2023-07-041-0/+4
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/http: copy only mime type from Content-TypeKacper Michajłow2023-06-291-1/+1
| | | | | | | | | Content-Type can include charset and boundary which is not a part of mime type and shouldn't be copied as such. Fixes HLS playback when the Content-Type includes additional fields. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/ac4dec: Constify demuxerAndreas Rheinhardt2023-06-291-1/+1
| | | | | | | The discrepancy between the definition and the declaration in allformats.c is actually UB. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/version: bump minor after recent additionsJames Almer2023-06-291-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/rawenc: add H266/VVC muxerThomas Siedel2023-06-293-0/+25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: add demuxer and probe support for H266/VVCThomas Siedel2023-06-294-2/+68
| | | | | | | Add demuxer to probe raw vvc and parse vvcc byte stream format. Co-authored-by: Nuo Mi <nuomi2021@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: use get_ue_golomb_long()James Almer2023-06-271-4/+4
| | | | | | | This partially reverts commit d0fc1b3507c, which reintroduced a regression originally fixed in 5e9986fd2d. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: fix overallocation when reading pssh/saizZhao Zhili2023-06-241-38/+25
| | | | | | | | | | | | | | | | | | | | | | | | mov_try_read_block() allocates 1MB at least, which can be more than enough. It was called when reading saiz box, which can appear periodically inside fmp4. This consumes a lot of memory. We can fix mov_try_read_block() by clamp 'block_size' with 'size'. However, the function is harmful than helpful. It avoids allocating large memory when the real data is small. Even in that case, if allocating large memory directly failed, it's fine to return ENOMEM; if allocating success and reading doesn't match the given size, it's fine to free and return AVERROR_INVALIDDATA. In other cases, it's a waste of CPU and memory. So I decided to remove the function, and replace it by call av_malloc() and avio_read() directly. mov_read_saiz() and mov_read_pssh() need more check, but they don't belong to this patch. Fixes #7641 and #9243. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/evc: remove duplicate definesJames Almer2023-06-231-4/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: add range checks to evcc_parse_sps and return proper error codesJames Almer2023-06-231-3/+10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: remove duplicate checkJames Almer2023-06-231-3/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: remove unnecessary structJames Almer2023-06-231-53/+14
| | | | | | And don't use get_ue_golomb_long() for known small values. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/id3v2: check the return value of avio_close_dyn_buf()James Almer2023-06-221-2/+4
| | | | | | | Fixes ticket #10424. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: move NALU length and type parsing functions to a headerJames Almer2023-06-213-43/+36
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evcdec: use an unsigned type for nalu_sizeJames Almer2023-06-211-2/+2
| | | | | | | But ensure the value returned by evc_read_nal_unit_length() fits in an int. Should prevent integer overflows later in the code. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evcdec: flush the bsf on EOFJames Almer2023-06-211-4/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evcdec: remove unnecessary av_packet_unref() callsJames Almer2023-06-211-12/+5
| | | | | | And return proper error codes. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evcdec: ensure there are enough bytes to seekbackJames Almer2023-06-211-1/+6
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* libavformat/mpegts.c: fix hardcoded 5-bytes skip for metadata streams.Romain Beauxis2023-06-201-1/+1
| | | | | | | | | | | | | | | | | | | Before the introduction of AV_CODEC_ID_TIMED_ID3 for timed_id3 metadata streams in mpegts (commit 4a4437c0fbc8f7afe0c533070395a42e56b4ee75), AV_CODEC_ID_SMPTE_KLV was the only existing codec for metadata. It seems that this codec has a 5-bytes metadata header[1] that, for some reason, was always skipped when decoding data packets. However, when working with a AV_CODEC_ID_TIMED_ID3 streams, this results in the 5 first bytes of the payload being cut-off, which includes essential informations such as the ID3 tag version. This patch fixes the issue by keeping the 5-bytes skip only for AV_CODEC_ID_SMPTE_KLV streams. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/jpegxl_anim_dec: fix out of array read using buffer paddingMichael Niedermayer2023-06-201-6/+7
| | | | | | | | Fixes: out of array read Fixes: 59828/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5029813220671488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/evcdec: don't set AVCodecParameters.framerateJames Almer2023-06-201-1/+0
| | | | | | It's not necessary. Setting AVStream.avg_frame_rate is enough. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evcdec: simplify au_end_found checkJames Almer2023-06-201-6/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evcdec: simplify probe functionJames Almer2023-06-201-22/+7
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/assenc: Fix potential NULL + 1Andreas Rheinhardt2023-06-201-2/+2
| | | | | | | | Incrementing a NULL pointer is undefined behaviour, yet this is what would happen in case trailer were NULL before the check. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/riffenc: Fix msrle support on Windows 95Tomas Härdin2023-06-201-2/+4
|
* avformat: add raw AC-4 muxerPaul B Mahol2023-06-204-1/+105
|
* lavf/rtpenc_jpeg: Retrieve sampling factor from SOF0Yeoh, Hoong Tee2023-06-201-15/+26
| | | | | | | | | | | | In ff_rtp_send_jpeg, the type is defined based on PIX_FMT and color-range parsed in. There is limitation on current design where need to include support newly introduced PIX_FMT such as AV_PIX_FMT_QSV and there might be more and more in future. Hence, retrive the sampling factor from SOF0 in JPEG compressed header directly. This introduces flexibility to handle different type of new codec introduced in future. Signed-off-by: Yeoh, Hoong Tee <hoong.tee.yeoh@intel.com>
* avformat/mpegts: add AC-4Aman Karmani2023-06-201-0/+1
|
* avformat/isom_tags: add AC-4Paul B Mahol2023-06-201-0/+1
|
* avformat: add raw AC-4 demuxerPaul B Mahol2023-06-204-1/+107
|
* avformat/evc: remove unused variableJames Almer2023-06-191-2/+1
| | | | | | And check the correct one. Should fix use of uninitialized value warnings. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: skip nalu header size bytes before parsing spsJames Almer2023-06-191-0/+7
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: use get_bits_long() where neededJames Almer2023-06-191-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: use get_ue_golomb_long()James Almer2023-06-181-6/+6
| | | | | | | Fixes compilation of shared libraries, as well as correctly parses width and height values. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/jpegxl_anim_dec: Perform operations in a different orderMichael Niedermayer2023-06-181-1/+1
| | | | | | | | Fixes: OOM Fixes: 59802/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5681765466112000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/jpegxl_anim_dec: avoid overrun with jxlp boxes in containerLeo Izen2023-06-181-26/+30
| | | | | | | | | This switches the jpegxl_collect_codestream_header function to use avcodec/bytestream2, which better enforces barriers, and should avoid overrunning buffers with jxlp boxes if the size is zero or if the size is so small the box is invalid. Signed-off-by: Leo Izen <leo.izen@gmail.com>
* avformat/hls: Forward stream metadata from subdemuxerArmin Hasitzka2023-06-171-0/+2
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/evcdec: set the demuxer as AVFMT_NOTIMESTAMPSJames Almer2023-06-161-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformt/version: bump minor after evc muxer and demuxer additionsJames Almer2023-06-151-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_demuxer: Extended MOV demuxer to handle EVC video contentDawid Kozinski2023-06-152-0/+3
| | | | | | - Added evc extension to the list of extensions for ff_mov_demuxer Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
* avformat/mov_muxer: Extended MOV muxer to handle EVC video contentDawid Kozinski2023-06-155-1/+502
| | | | | | | - Changes in mov_write_video_tag function to handle EVC elementary stream - Provided structure EVCDecoderConfigurationRecord that specifies the decoder configuration information for ISO/IEC 23094-1 video content Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
* avformat/evc_demuxer: Added demuxer to handle reading EVC video filesDawid Kozinski2023-06-153-0/+278
| | | | | | - Provided AVInputFormat struct describing EVC input format (ff_evc_demuxer) Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
* avformat/evc_muxer: Added muxer to handle writing EVC encoded data into file ↵Dawid Kozinski2023-06-153-0/+15
| | | | | | | | | or output bytestream - Provided AVOutputFormat structure describing EVC output format (ff_evc_muxer) - Added documentation for EVC muxer Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
* avcodec: add VMX1 decoderPaul B Mahol2023-06-121-0/+1
|
* avformat/hlsenc: fix CODECS attribute of H.264Zhao Zhili2023-06-121-2/+12
| | | | | | | | 1. Add avcc extradata support. 2. Add non-standard annexb support with 0 0 1 as prefix for SPS. Reviewed-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/jpegxl_probe: Forward error codesMichael Niedermayer2023-06-111-6/+8
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/jpegxl_probe: check length instead of blindly readingMichael Niedermayer2023-06-111-1/+13
| | | | | | | | | | | | | | Enable the checked bitreader to avoid overread. Also add a few checks in loops and between blocks so we exit instead of continued execution. Alternatively we could add manual checks so that no overread can happen. This would be slightly faster but a bit more work and a bit more fragile Fixes: Out of array accesses Fixes: 59640/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-6584117345779712 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/jpegxl_probe: Remove intermediate macro obfuscation around get_bits*()Michael Niedermayer2023-06-111-84/+85
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>