summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avformat/utils: Improve ffio_limit logicAndreas Rheinhardt2020-12-11
| | | | | | | | | | | | | | | The earlier code would not complain if the remaining size was one byte short of the desired size; and the way it performed the check could run into signed integer overflow. Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long' Fixes: Timeout Fixes: 26434/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5752845451919360 Fixes: 26444/clusterfuzz-testcase-minimized-ffmpeg_dem_BINK_fuzzer-4697773380993024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavf/rawdec: Return a low score if the mjpeg probe function detected one frame.Carl Eugen Hoyos2020-12-11
| | | | Fixes ticket #9026.
* avfilter/af_earwax: fix check that was left in previous commitPaul B Mahol2020-12-10
| | | | Makes output exact with smaller number of samples per frame than taps.
* avformat/hashenc: Reuse hash_free() for framehash muxersAndreas Rheinhardt2020-12-10
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: set AV_CODEC_CAP_CHANNEL_CONF on decoders which set their own channelsHendrik Leppkes2020-12-10
| | | | | | | | | | | | The decoders in this set either have a fixed channel count, or read it from the bitstream, and thus do not require the channel count as external information. Fixes various regressions since 81503ac58a763a36b1f57264013b1e76acb62b68, which requires a valid channel count for decoders which do not set this capability. Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* tests/audiomatch: add free to make static analysis tools happyJun Zhao2020-12-10
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/mov: remove an always true conditionZhao Zhili2020-12-10
|
* smvjpegdec: merge into mjpegdecAnton Khirnov2020-12-10
| | | | | | | | | | | | | | | | | | | | | | | SMVJPEG stores frames as slices of a big JPEG image. The decoder is implemented as a wrapper that instantiates a full internal MJPEG decoder, then forwards the decoded frames with offset data pointers. This is unnecessarily complex and fragile, not supporting useful decoder capabilities like direct rendering. Re-implement the decoder inside the MJPEG decoder, which is accomplished by returning each decoded frame multiple times, setting cropping information appropriately on each instance. One peculiar aspect of the previous design is that since - the smvjpeg decoder returns one frame per input packet - there are multiple frames in each packets (the aformentioned slices) the demuxer needs to return each packet multiple times. This is now also eliminated - the demuxer now returns each packet exactly once, with the duration set to the number of frames it decodes to. This also removes one of the last remaining internal uses of the old video decoding API.
* mjpegdec: convert to receive_frame()Anton Khirnov2020-12-10
| | | | This will be useful in the following commit.
* tests: stop using -vsync dropAnton Khirnov2020-12-10
| | | | | | | | It depends on the muxer generating the timestamps, which is deprecated and scheduled for removal on next bump. A bunch of tests change timestamps, because of ffmpeg.c is not generating them correctly. This should be fixed later.
* ffmpeg: stop accessing deprecated stream-embedded codec contextAnton Khirnov2020-12-10
|
* lavf/mux: rewrite guessing the packet durationAnton Khirnov2020-12-10
| | | | | | Factor out the code into a separate muxing-specific function. Stop accessing the deprecated AVStream-embedded codec context, use the average framerate (if specified) instead.
* tests: drop api-codec-param testAnton Khirnov2020-12-10
| | | | It fundamentally depends on deprecated lavf internals.
* lavd/caca: do not access deprecated codec contextAnton Khirnov2020-12-10
| | | | Use the stream timebase instead.
* codec_desc: add SMVJPEG flagsAnton Khirnov2020-12-10
| | | | Same flags as MJPEG, as it's essentially the same codec.
* img2dec: export avg_frame_rateAnton Khirnov2020-12-10
|
* avcodec/hevcdec: dynamic allocate sList and HEVClcListNuo Mi2020-12-10
| | | | | | | | | following comandline will crash the ffmpeg ffmpeg -threads 17 -thread_type slice -i WPP_A_ericsson_MAIN_2.bit out.yuv -y the HEVCContext->sList size is MAX_NB_THREADS(16), any > 16 thread number will crash the application Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec/snow: Use ff_thread_once() in ff_snow_common_init()Andreas Rheinhardt2020-12-10
| | | | | | | | | | | | ff_snow_common_init() currently initializes static data every time it is invoked; given that both the Snow encoder and decoder have the FF_CODEC_CAP_INIT_THREADSAFE flag set, this can lead to data races (and therefore undefined behaviour) even though all threads write the same values. This commit fixes this by using ff_thread_once() for the initializations. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/idcinvideo: Mark decoder as init-threadsafeAndreas Rheinhardt2020-12-10
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cinepak: Mark decoder as init-threadsafeAndreas Rheinhardt2020-12-10
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cinepakenc: Mark encoder as init-threadsafeAndreas Rheinhardt2020-12-10
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Sanity check codec_id/track typeMichael Niedermayer2020-12-09
| | | | | | | | Fixes: memleak Fixes: 27766/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-5198300814508032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rpl: Check the number of streamsMichael Niedermayer2020-12-09
| | | | | | | | | Fixes: out of memory access Fixes: 27787/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-4743666463408128.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check sample_rateMichael Niedermayer2020-12-09
| | | | | | | | | Fixes: Assertion c > 0 failed at libavutil/mathematics.c Fixes: 27001/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5726041328582656 Fixes: 27453/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5716060384526336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Make len signedMichael Niedermayer2020-12-09
| | | | | | | | Fixes: out of array access Fixes: 27424/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5682070692823040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vaapi_av1: fill the remaining VAFilmGrainStructAV1 fieldsJames Almer2020-12-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/exr: preserve half-float NaN bits and add fate testMark Reid2020-12-09
| | | | | Handles NaNs more like the official implementation handles them, preserving the original bits.
* avfilter/cropdetect: add option for initial skipGyan Doshi2020-12-09
| | | | | | | | | | The cropdetect filter, at present, skips the first two frames. This behaviour is hardcoded. New option 'skip' allows users to change this. Convenient for when input is a single image or a trimmed video stream. Default is kept at 2 to preserve current behaviour.
* avcodec/mpegvideo_enc: check for SpeedHQ encoderGyan Doshi2020-12-09
| | | | | Avoids build failure when mpegvideo_enc is built but SpeedHQ encoder isn't.
* avcodec/libaom: Support monochrome encoding with libaom >= 2.0.1Philip Langdale2020-12-08
| | | | | | | | | | | Monochrome encoding with libaom was buggy for a long time, but this was finally sorted out in libaom 2.0.1 (2.0.0 is almost there but was still buggy in realtime mode). We'll keep support for libaom 1.x around until the LTS distros that include it are EOL (which is still a long time from now). Fixes: https://trac.ffmpeg.org/ticket/7599
* avformat/framecrcenc: Make side-data checksums endian-independentAndreas Rheinhardt2020-12-08
| | | | | | | | | Do this by converting big-endian side data to little endian for checksumming. Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/framecrcenc: Don't read after the end of side-dataAndreas Rheinhardt2020-12-08
| | | | | | | | | | | Nothing guarantees that the size of side data containing a palette is actually divisible by four (although it should be); but for big-endian systems, an algorithm is used that presupposed this. So switch to an algorithm that does not overread: It processes four bytes at a time, but only if all of them are contained in the side data. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/wmadec: Apply VLC offset during initAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/wmadec: Reduce the size of tables used to initialize VLCAndreas Rheinhardt2020-12-08
| | | | | | | | By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one can replace a table of codes of type uint16_t by a table of symbols of type uint8_t, saving space. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ivi: Make initializing VLCs thread-safeAndreas Rheinhardt2020-12-08
| | | | | | This automatically makes indeo4/5 init-threadsafe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dsddec: Inline constantAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dsd: Make initializing DSD tables thread-safeAndreas Rheinhardt2020-12-08
| | | | | | | This automatically makes the DSD formats as well as DST and WavPack init-threadsafe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/wavpack: Fix leak on init failureAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/h261enc: Remove unused function parameterAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/asvdec: ReindentationAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/asvdec: Make decoders init-threadsafeAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sinewin: Fix wrong number of elements of array declarationAndreas Rheinhardt2020-12-08
| | | | | | There are actually only 14 elements in each ff_sine_windows array. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/aactab: Make AAC encoder and decoders actually init-threadsafeAndreas Rheinhardt2020-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 1a29804558c13ef512d9ef73a9b0d782af4fa5f2 guarded several initializations of static data in the AAC decoders with an AVOnce and set the FF_CODEC_CAP_INIT_THREADSAFE flag, believing the former to be sufficient for the latter. It wasn't, because several of these static tables are shared with other components, so that there might be data races if they are initialized from multiple threads. This affected initializing the ff_sine_* tables as well as initializing the ff_aac_pow*sf_tab tables (shared between both decoders and encoder) as well as ff_aac_kbd_* tables (shared between encoder and floating point decoder). Commit 3d62e7a30fa552be52d12b31e3e0f79153aff891 set the FF_CODEC_CAP_INIT_THREADSAFE flag for the AAC encoder. More explicitly, this commit used the same AVOnce to guard initializing ff_aac_pow*sf_tab in the encoder and to guard initializing the static data of each decoder; the ensuing catastrophe was "fixed" in commit ec0719264cb9a9d5cbaf225da48929aea24997a3 by using a single AVOnce for each codec again. But the codec cap has not been removed and therefore the encoder claimed to be init-threadsafe, but wasn't, because of the same tables as above. The ff_sine_* tables as well as ff_aac_pow*sf_tab tables have already been fixed; this commit deals with the ff_aac_kbd_* tables, making the encoder as well as the floating-point decoder init-threadsafe (the fixed-point decoder is it already). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/aac: Share common init code of float decoder and encoderAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/aacdec, aactab: Move kbd tables to their only userAndreas Rheinhardt2020-12-08
| | | | | | | | | | | | The floating point kbd tables for 120 and 960 samples are only used by the floating point decoder whereas the fixed point kbd tables for 128 and 1024 samples are only used by the fixed point AAC decoder. So move these tables to their only users. This ensures that they are not accidentally used somewhere else without ensuring that initializing these tables stays thread-safe (as it is now because the only place from where they are initialized is guarded by an AVOnce). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/aactab: Remove declaration of inexistent arrayAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/nellymoserenc: Make encoder init-threadsafeAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/nellymoserenc: Cleanup generically on init failureAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/nellymoserdec: Make decoder init-threadsafeAndreas Rheinhardt2020-12-08
| | | | | | Easy now that initializing the ff_sine_* tables is thread-safe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/atrac3plus: Make decoders init-threadsafeAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>