summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avcodec/rv40vlc2: Make VLC smallerAndreas Rheinhardt2020-11-24
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/qdm2: Remove outdated commentAndreas Rheinhardt2020-11-24
| | | | | | Forgotten in f054e309c58894450a5d18cce9799ef58aab9f14. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudiodsp: Make initializing synth windows thread-safeAndreas Rheinhardt2020-11-24
| | | | | | | | | | These arrays are used by the Musepack decoders, the MPEG audio decoders as well as qdm2 and up until now, these arrays might be initialized more than once, leading to potential data races as well as unnecessary initializations. Therefore this commit ensures that each array will only be initialized once. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudiodsp: Make ff_mpadsp_init() thread-safeAndreas Rheinhardt2020-11-24
| | | | | | | | | | The only thing missing for this is to make ff_mpadsp_init_x86() thread-safe; it currently isn't because a static table is initialized every time ff_mpadsp_init() is called (when ARCH_X86 is true). Solve this by initializing this table only once, namely together with the ordinary not-arch specific tables. This also allows to reuse their AVOnce. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/fft_template, fft_init_table: Make ff_fft_init() thread-safeAndreas Rheinhardt2020-11-24
| | | | | | | | | | | | | | | | | | | | | | | | Commit 1af615683e4a1a858407afbaa2fd686842da7e49 put initializing the ff_fft_offsets_lut (which is typically used if FFT_FIXED_32) behind an ff_thread_once() to make ff_fft_init() thread-safe; yet there is a second place where said table may be initialized which is not guarded by this AVOnce: ff_fft_init_mips(). MIPS uses this LUT even for ordinary floating point FFTs, so that ff_fft_init() is not thread-safe (on MIPS) for both 32bit fixed-point as well as floating-point FFTs; e.g. ff_mdct_init() inherits this flaw and therefore initializing e.g. the AAC decoders is not thread-safe (on MIPS) despite them having FF_CODEC_CAP_INIT_CLEANUP set. This commit fixes this by moving the AVOnce to fft_init_table.c and using it to guard all initializations of ff_fft_offsets_lut. (It is not that bad in practice, because every entry of ff_fft_offsets_lut is never read during initialization and is only once ever written to (namely to its final value); but even these are conflicting actions which are (by definition) data races and lead to undefined behaviour.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudiodsp: Combine initializing float and int tablesAndreas Rheinhardt2020-11-24
| | | | | | | This avoids code duplication in the functions used to initialize them and allows to remove an AVOnce. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/motionpixels: Make decoder init-threadsafeAndreas Rheinhardt2020-11-24
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/motionpixels: Use symbols tableAndreas Rheinhardt2020-11-24
| | | | | | | If allows us to directly store the deltas in the VLC table and therefore avoids a level of indirection. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/motionpixels: Don't check for errors for complete VLCAndreas Rheinhardt2020-11-24
| | | | | | | The algorithm used here always creates a complete VLC, so it is unnecessary to check this again. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/motionpixels: Be more strict when parsing Huffman treesAndreas Rheinhardt2020-11-24
| | | | | | | | This ensures that the number of leafs in the Huffman tree equals the number it is supposed to be and therefore ensures that the VLC tree is complete, allowing us to remove checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/motionpixels: Only create VLC iff it is going to be usedAndreas Rheinhardt2020-11-24
| | | | | | | | | | | | | | | | | | | | | If the Huffman tree consists of only one entry (which has length zero), no tree is used at all for parsing as the VLC API currently can't handle this. So it makes no sense to create a VLC in this case. Commit 41b7389cade702383e59343561776f83bb26e17f added a check for whether creating the VLC should be skipped, but it also skipped decoding the packet and it used the wrong check: It checked max_codes_bits, the maximum length of a code; but this value is only updated iff there is more than one Huffman entry. So if there is only one Huffman entry, and there was a previous frame with more than one entry, then a VLC was created unnecessarily; yet if there was no previous frame with more than one entry, then this frame will be skipped which is probably spec-incompliant. I have no sample for the latter. This commit improves the check to create a VLC iff it is going to be used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mimic: Mark decoder as init-threadsafeAndreas Rheinhardt2020-11-24
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mimic: Cleanup generically upon init failureAndreas Rheinhardt2020-11-24
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/rv10: Make initializing static RV10 VLCs thread-safeAndreas Rheinhardt2020-11-24
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/smacker: Mark decoders as init-threadsafeAndreas Rheinhardt2020-11-24
| | | | | | Both Smacker audio and video decoders don't use/modify any global state. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/tscc2: Mark tscc2 decoder as init-threadsafeAndreas Rheinhardt2020-11-24
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_adenorm: add timeline and slice threading supportPaul B Mahol2020-11-24
|
* avfilter/af_asubboost: add timeline and slice threading supportPaul B Mahol2020-11-24
|
* avcodec: add SpeedHQ encoderJean-Baptiste Kempf2020-11-24
|
* avformat/av1: add support for passing through MP4/Matroska av1cJan Ekström2020-11-24
|
* avcodec/av1{dec,parser}: move to ff_cbs_read_extradata_from_codecJan Ekström2020-11-24
| | | | | | This lets us re-utilize the extradata-related checks in the CBS to add support for passing the AV1CodecConfigurationRecord as extradata as-is without further filtering.
* avcodec/cbs_av1: add support for standard MP4/Matroska extradataJan Ekström2020-11-24
| | | | | This way API clients can just pass the AV1CodecConfigurationRecord as extradata as-is without further filtering.
* cbs: Add function to read extradata from an AVCodecContextMark Thompson2020-11-24
| | | | | This is useful in decoders and parsers, matching the way that bitstream filters read extradata from AVCodecParameters.
* avdevice/decklink_dec: fix warning for unused variableLimin Wang2020-11-23
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avdevice/decklink: add AV_OPT_FLAG_DEPRECATED flag for list_devicesLimin Wang2020-11-23
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avdevice/decklink: use boolean for list_devices optionLimin Wang2020-11-23
| | | | | | | For the document(indevs.texi and outdevs.texi) used it as boolean. Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/af_aiir: add support for arbitrary order lattice-ladder filter formatPaul B Mahol2020-11-22
|
* avcodec/exr: skip bottom clearing loop when its outside the imageMichael Niedermayer2020-11-22
| | | | | | | | Fixes: signed integer overflow: 1633771809 * 32960 cannot be represented in type 'int' Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/exr: Check ymin vs. hMichael Niedermayer2020-11-22
| | | | | | | | | Fixes: out of array access Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344 Fixes: 27443/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5631239813595136 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/avs: Use 64bit for the avio_tell() outputMichael Niedermayer2020-11-22
| | | | | | | | Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long' Fixes: 26549/clusterfuzz-testcase-minimized-ffmpeg_dem_AVS_fuzzer-4844306424397824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/moflex: Check pkt_sizeMichael Niedermayer2020-11-22
| | | | | | | | Fixes: Timeout (>20sec -> 1ms) Fixes: 26527/clusterfuzz-testcase-minimized-ffmpeg_dem_MOFLEX_fuzzer-6308307310215168 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_biquads: remove not needed codePaul B Mahol2020-11-22
|
* avformat/movenc: allow Apple Lossless inside mp4Leo Izen2020-11-22
| | | | | | The 'alac' identifier has been registered to ISO and thus towards ISOBMFF at the MP4 registration authority. The existing non-MOV mux mode matches the official ALAC-in-MP4 specification.
* avfilter/af_afreqshift: add timeline and slice threading supportPaul B Mahol2020-11-22
|
* avcodec/atrac3: increase max block align sizePaul B Mahol2020-11-21
| | | | | Fixes decoding of lossy part of advanced lossless atrac3. Regression since f09151fff9c754fbc1d2560adf18b14957f8b181
* avcodec/mobiclip: Check mv against INT_MAXMichael Niedermayer2020-11-21
| | | | | | | | Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 27369/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-5083469356728320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/wavdec: More complete size check in find_guid()Michael Niedermayer2020-11-21
| | | | | | | | Fixes: signed integer overflow: 9223372036854775807 + 8 cannot be represented in type 'long' Fixes: 27341/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5442833206738944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mv30: Use unsigned in idct_1d()Michael Niedermayer2020-11-21
| | | | | | | | Fixes: signed integer overflow: 2110302399 + 39074947 cannot be represented in type 'int' Fixes: 27330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5664923153334272 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/iff: Check size before skipMichael Niedermayer2020-11-21
| | | | | | | | Fixes: Infinite loop Fixes: 27292/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5731168991051776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rmdec: Check for EOF in index packet readingMichael Niedermayer2020-11-21
| | | | | | | | Fixes: Timeout(>10sec -> 1ms) Fixes: 27284/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6304211110985728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cuviddec: fix missing context push/popleozhang2020-11-21
| | | | | | | | Test command like below: cuda-memcheck ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input_file -c:v h264_nvenc -f null - Signed-off-by: leozhang <nowerzt@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avformat/rtsp: don't forget to call ff_network_close() on errorAndriy Gelman2020-11-21
| | | | | | | | | | | In sdp_read_header() some ff_network_close() calls were missed. Also in rtp_read_header() update comment to explain why a single call to ff_network_close() is enough to cover all cases even if sdp_read_header() returns an error. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtsp: set return variable in error pathAndriy Gelman2020-11-21
| | | | | | | | In this error path ret still stores the number of bytes read in ffurl_read(). Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtspdec: cosmeticsAndriy Gelman2020-11-21
| | | | | | Make error check style consistent with rest of function. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtspdec: fix mem leaks in connect mode if init failsAndriy Gelman2020-11-21
| | | | | | | Fixes #6334 Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtspdec: fix mem leaks in listen mode if init failsAndriy Gelman2020-11-21
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtspdec: add network init to listen modeAndriy Gelman2020-11-21
| | | | | | | | | | | | | As per the docs network initialization is required before ff_url_join(). Furthermore, because the ff_network_init() was skipped, this makes one additional call to ff_network_close() if the stream exits without errors. The was forgotten in the origin commit of the listen mode: a8ad6ffafe89e3a83f343f69249338e8245816f7 Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avdevice/decklink_dec: map the raw_format instead of hardcodeLimin Wang2020-11-21
| | | | | | | | The patch will change the numerical values for the string constants so bump micro version. Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* tools/target_bsf_fuzzer: set bitstream filter optionsJames Almer2020-11-20
| | | | | | Should increase coverage with some bitstream filters Signed-off-by: James Almer <jamrial@gmail.com>
* tools/target_bsf_fuzzer: Call av_bsf_flush() in a fuzzer choosen patternJames Almer2020-11-20
| | | | | | | | This should increase coverage. Based on a commit by Michael Niedermayer Signed-off-by: James Almer <jamrial@gmail.com>