aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
...
* avformat/flvdec: Free metaVideoColorMichael Niedermayer2024-09-191-0/+1
| | | | | | | | | Fixes: memeleak Fixes: 70659/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-4539872627458048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/mxfdec: Handle KLV fillTomas Härdin2024-09-181-0/+1
|
* lavf/mxfdec: Switch to mxf_metadata_read_table loop to FF_ARRAY_ELEMS, skip ↵Tomas Härdin2024-09-181-7/+11
| | | | if read == NULL
* avformat/mov_chan: add extra checks to channel description countJames Almer2024-09-171-2/+14
| | | | | | | | | | Make sure it's not zero, and equal or bigger than number of channels Fixes: Timeout / DOS Fixes: 67143/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-4858720481771520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/dvdvideodec: implement seekingMarth642024-09-151-5/+72
| | | | | | | | | Player applications can now enjoy seeking while playing back a title. Accuracy is at the mercy of what libdvdnav exposes, which is currently dvdnav_time_search(). Signed-off-by: Marth64 <marth64@proxyid.net> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf/tls_mbedtls: restrict TLSv1.3 verification workaround to affected versionsfan52024-09-151-2/+2
| | | | | | | | Now that mbedTLS 3.6.1 is released we know that only 3.6.0 contains this regression. ref: c28e5b597ecc34188427347ad8d773bf9a0176cd Signed-off-by: sfan5 <sfan5@live.de> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/dashdec: The segments in dash file doesn't read completely when ↵jiangjie2024-09-141-1/+1
| | | | | | | | | | | | | | | segment's size and duration is very small. If the segment is very small, avformat_find_stream_info will read all audio/video data in this segment. cur->is_restart_needed is set to 0 later in dash_read_packet, and no chance to be set to 1 again in the read_data function. Reproduction: ffmpeg -f lavfi -i mandelbrot -f lavfi -i anullsrc -c:v vp8 \ -g 5 -r 5 -c:a libopus -use_template 0 -seg_duration 1 \ -t 15 -y test_720.mpd ffprobe -show_packets test_720.mpd
* avformat/mxfdec: narrow variable scopesMarvin Scholz2024-09-131-19/+16
|
* avformat/mxfdec: fix variable shadowingMarvin Scholz2024-09-131-9/+9
|
* avformat/crypto: fix variable shadowingMarvin Scholz2024-09-131-2/+2
|
* avformat/network: use av_err2str to simplify codeMarvin Scholz2024-09-131-14/+7
| | | | | No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used.
* avformat/mxfenc: Fix guess frame_rateNicolas Gaullier2024-09-041-2/+6
| | | | | | | | | | | | | | | | | | | The time_base was a bad guess. Currently, fate-time_base test data assumed that overriding the input time_base would affect the frame_rate, but this behaviour is not documented, so just fix the fate data now that this is fixed. Fix regression since 10185e2d4c1e9839bc58a1d6a63c861677b13fd0: previously, when streamcopying, the time_base was guessed from the frame_rate considering it is often constant, so guessing the frame_rate back from the time_base was often not a problem. To reproduce: ffmpeg -i fate-suite/mpeg2/dvd_still_frame.vob -an -c copy out.mxf Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/libzmq: fix check for zmq protocol prefixMarton Balint2024-09-021-1/+1
| | | | | | Fixes ticket #11134. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: disallow generic seek searchMarton Balint2024-09-021-1/+1
| | | | | | | | | | If the demuxer does not provide per-stream indexes, the generic seek search can attempt to read the whole media file from the beginning when seeking. For large MXF files this can cause huge lockups for a seek after the last timestamp, which will eventually fail. So let's disable the generic seek for mxf, the demuxer's own seek code should handle seeking just fine. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/rtsp: extend the PATH buffer to 2048Stefano Mandelli2024-09-021-1/+1
| | | | | | | | | | | | | | | | Recently, I have been experiencing an increasing number of user that use ffmpeg to retrive RTSP stream from personal mediaproxies (e.g. MediaMtx) with authorization based on JWT. The current length of PATH does not permit to insert the token in the URL failing the authorization with no possibilities to get the video. VLC has just modified the RSTP max URL length, and it permits to use token inside the URL. For these reasons, I propose this patch to extend the PATH buffer from 1024 to 2048 in order to use tokens and the authorization process based on JWT. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavc/opus*: move to opus/ subdirAnton Khirnov2024-09-021-1/+1
|
* avformat/iamf_parser: use ffio_read_size() where usefulJames Almer2024-08-311-24/+16
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: Fix return of uninitialized valueMarvin Scholz2024-08-311-1/+2
| | | | | | | | | | | The ret value here is not yet intialized so the return would return uninitialized data. What was probably meant to be checked here was the return value of ffio_read_size, which can return an error. Introduced in 38bcb3ba7b3424abd772c72f8bdf445d75285e88 Fixes: CID1618758 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: use get_bits_long() to read the remaining AAC extradata ↵James Almer2024-08-311-2/+2
| | | | | | | | | | | bits The output of put_bits_left() here can be as big as 27, which is a bit count not supported by get_bits(). Fixes fate-iamf-stereo-demux when using --assert-level=2 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: fix parsing AAC DecoderConfigDescriptorJames Almer2024-08-311-10/+7
| | | | | | | | | Use ff_mp4_read_descr() to read both the tags and the vlc value that comes after it, which was not being taken into account. Ref: https://github.com/AOMediaCodec/libiamf/issues/119 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/isom: make parameters used for loging a pointer to voidJames Almer2024-08-312-11/+11
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mvdec: Check if name was fully readMichael Niedermayer2024-08-281-1/+2
| | | | | | | | Fixes: use of uninitialized value Fixes: 70901/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-6341913949569024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/argo_brp: Check that ASF chunk header is completely readMichael Niedermayer2024-08-281-2/+2
| | | | | | | | Fixes: Use of uninitialized value Fixes: 71280/clusterfuzz-testcase-minimized-ffmpeg_dem_ARGO_BRP_fuzzer-4692991866896384 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/apetag: Check APETAGEXMichael Niedermayer2024-08-281-1/+2
| | | | | | | | Fixes: Use of uninitialized value Fixes: 71074/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5697034877730816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vapoursynth: load library at runtimeStefan Oltmanns2024-08-261-2/+63
| | | | Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
* avformat/vapoursynth: Update to API version 4Stefan Oltmanns2024-08-261-38/+39
| | | | Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
* avformat/iamf_parse: clear paddingMichael Niedermayer2024-08-181-0/+1
| | | | | | | | | Fixes: use of uninitialized value Fixes: 70929/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5931276639469568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: Fix nullptr dereference with invalid encryption metadata.Dale Curtis2024-08-181-2/+6
| | | | | | | | Found by fuzzer. Bug: https://crbug.com/356720789 Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/demux: don't reallocate a AVCodecContext when closing a non-open codec.Dale Curtis2024-08-171-3/+6
| | | | | | | | | This results in an unnecessary ~800k allocation with H.264. A nearby callsite uses avcodec_is_open() to avoid this, so do the same when exiting avformat_find_stream_info(). Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/hlsenc: correctly reset subtitle stream counter per-varstreamTimo Rothenpieler2024-08-161-1/+1
| | | | | | Without resetting it, if there was a previous set of varstreams with subtitles, it would subtract from all the streams, leading to chaos and segfaults when trying to access for example stream -1.
* avformat/iamf_parse: ignore Audio Elements with an unsupported typeJames Almer2024-08-142-3/+8
| | | | | | Better fix for the NULL pointer dereference from d7f83fc2f423. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/av1dec: Better fix for ↵Michael Niedermayer2024-08-141-3/+1
| | | | | | 70872/clusterfuzz-testcase-minimized-ffmpeg_dem_OBU_fuzzer-6005782487826432 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpeg: Check an avio_read() for failureMichael Niedermayer2024-08-141-1/+3
| | | | | | | | Fixes: use-of-uninitialized-value Fixes: 70849/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGPS_fuzzer-4684401009557504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/iamfdec: Check nb_layers before dereferencing layerMichael Niedermayer2024-08-141-1/+1
| | | | | | | | | Fixes: dereferencing pointers near NULL Fixes: 70432/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5255672845893632 Fixes: 70877/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5348547432611840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/av1dec: Check bits left before get_leb128()Michael Niedermayer2024-08-141-0/+3
| | | | | | | | Fixes: use of uninitialized value Fixes: 70872/clusterfuzz-testcase-minimized-ffmpeg_dem_OBU_fuzzer-6005782487826432 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segafilm: Set keyframeMichael Niedermayer2024-08-141-0/+1
| | | | | | | | Fixes: use of uninitialized value Fixes: 70871/clusterfuzz-testcase-minimized-ffmpeg_dem_SEGAFILM_fuzzer-5883617752973312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/avisynth: move avs_planes* consts into relevant functionStephen Hutchinson2024-08-131-11/+11
| | | | | | | | These consts are only used in the switch(planar) case located in avisynth_create_stream_video and nowhere else in the demuxer, so move them into that function directly. Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
* avformat/avisynth: remove library allocation from global stateStephen Hutchinson2024-08-131-69/+64
| | | | | | | | | As part of this, the mutexes are no longer necessary, and avisynth_read_close needs to check that avs->avs_library.library still exists before it attempts to call avisynth_context_destroy and dlclose. Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
* avformat/avisynth: remove mutex lock from avisynth_read_closeStephen Hutchinson2024-08-131-4/+0
| | | | Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
* avformat/avisynth: remove atexit() handlerStephen Hutchinson2024-08-131-45/+1
| | | | | | | | | | | | | | | | | | | The atexit() handler in the avisynth demuxer was added because there was a conflict in AvxSynth that arose due to their use of C++ global objects, particularly in relation to having added a logging function relying on log4cpp. This conflict was responsible for causing a segfault on exit. It did not affect Windows with the (at the time) upstream AviSynth 2.5 and 2.6, nor does it affect AviSynth+. Unfortunately, none of this was actually shielded by ifdefs indicating the fact it was only needed for AvxSynth, so four years ago when AviSynth+ replaced AvxSynth as the handler for AviSynth scripts on Unix-like OSes, the fact that the atexit handler was no longer necessary was overlooked. Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
* avformat/movenc: don't look at previous track_id as it may not be setJames Almer2024-08-121-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/lmlm4: Eliminate some AVERROR(EIO)Michael Niedermayer2024-08-111-3/+3
| | | | | | | Found by code review related to CID732224 Overflowed constant Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/lmlm4: Move subtraction after checkMichael Niedermayer2024-08-111-1/+1
| | | | | | | | | This is not a bugfix in code but coverity only, it does look a little nicer though Fixes: CID732224 Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/wtvdec: Check length of read mpeg2_descriptorMichael Niedermayer2024-08-081-1/+2
| | | | | | | | | Fixes: Use of uninitialized value Fixes: 70900/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6286909377150976 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/wtvdec: clear sectorsMichael Niedermayer2024-08-081-1/+1
| | | | | | | | | | The code can leave uninitialized holes in the array. Fixes: use of uninitialized values Fixes: 70883/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6698694567591936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: ensure required number of bytes is readKacper Michajłow2024-08-081-1/+1
| | | | | | | | Fixes: use-of-uninitialized-value Found by OSS-Fuzz. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/iamf: use aligned intreadwrite macros where possibleJames Almer2024-08-073-14/+14
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: use stream indexes when generating track idsJames Almer2024-08-071-1/+5
| | | | | | | | | | | In some scenarios nb_tracks isn't the same as nb_streams, so a given id may end up being used for two separate streams. e.g. when muxing an IAMF track followed by a video track, if the IAMF track consists of several streams, the video track would end up having an id of 2, which may also be used by one of the IAMF streams. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/rtpproto: free ip filters on open errorKacper Michajłow2024-08-071-0/+1
| | | | | | | Found by OSS-Fuzz. Signed-off-by: Kacper Michajłow <kasper93@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/srtpproto: pass options to nested protocolKacper Michajłow2024-08-071-3/+3
| | | | | | | | | This fixes passing options dict. Fixes some timeouts found by OSS-Fuzz. Signed-off-by: Kacper Michajłow <kasper93@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>