summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/cbs_av1: Free content in cbs_av1_free_metadata()Michael Niedermayer2020-10-12
| | | | | | | | | Fixes: memleak Fixes: 25838/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5736255957237760 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>
* avcodec/apedec: use proper macro and type for pivot variablePaul B Mahol2020-10-12
|
* avcodec/apedec: properly calculate and store absolute valuePaul B Mahol2020-10-12
|
* avcodec/apedec: fix decoding 24bit insane files with recent versionsPaul B Mahol2020-10-12
|
* avformat/isom: add support for RAW ASC Bayer BGGR in movPaul B Mahol2020-10-12
|
* avcodec/mpeg12: Don't pretend reading dct_dc_size_* VLCs can failAndreas Rheinhardt2020-10-12
| | | | | | | | | | It can't because the corresponding trees don't have any loose ends. Removing the checks also removed an instance of av_log(NULL (with a nonsense message) from the codebase. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg12: Reduce size of motion-vector VLCAndreas Rheinhardt2020-10-12
| | | | | | | | | | It currently uses 9 bits per table, but there are no codes with nine bits at all, while there are codes with eight, ten and eleven bits. So reducing the table size to eight bits will not reduce the amount of codes that can be parsed in the first step, but it allows to reduce the size of the motion-vector VLC. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc, lavf: Remove newlines from calls to avpriv_request_sample().Carl Eugen Hoyos2020-10-11
|
* avcodec/exr: Check line size for overflowMichael Niedermayer2020-10-11
| | | | | | | | Fixes: signed integer overflow: 570425356 * 6 cannot be represented in type 'int Fixes: 25929/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5099197739827200 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 xdelta, ydeltaMichael Niedermayer2020-10-11
| | | | | | | | Fixes: assertion failure Fixes: 25617/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5648746061496320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: Check block align for AV_CODEC_ID_ADPCM_PSXMichael Niedermayer2020-10-11
| | | | | | | | | Regression since: ca49476ace90ddebc5f92d9d82297f77e528c21e Fixes: out of array write Fixes: 25786/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5704869380620288 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mobiclip: Fix multiple integer overflowsMichael Niedermayer2020-10-11
| | | | | | | | | Fixes: signed integer overflow: 872415232 * 7 cannot be represented in type 'int' Fixes: signed integer overflow: -2013265888 + -1744830464 cannot be represented in type 'int' Fixes: 25834/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-5471406434025472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/codec.h: add missing FF_API_NEXT wrapperJames Almer2020-10-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vp9: Fix stack-buffer overflow with VP9 VDPAU availableAndreas Rheinhardt2020-10-11
| | | | | | | | | | | | | ccca62ef991f0a47dfa30c3e822d91294b8afe4c added new VP9 VDPAU profiles and as a consequence AV_PIX_FMT_VDPAU can now be twice in the list of pixel formats used for format negotiation by ff_thread_get_format(); yet there is only one entry in said list reserved for VDPAU, leading to a stack-buffer overflow. This commit fixes this by making sure that AV_PIX_FMT_VDPAU will not occur twice in said list. Fixes Coverity ticket 1468046. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sheervideo: Avoid code duplication when creating VLC tablesAndreas Rheinhardt2020-10-10
| | | | | | | | | The SheerVideo decoder uses two VLC tables and these are in turn created from structures (called SheerTable) that are naturally paired. This commit unifies these pairs of SheerTables to arrays and unifies creating the VLC tables. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sheervideo: Reduce the size of static arraysAndreas Rheinhardt2020-10-10
| | | | | | | | | | | | | | | The SheerVideo decoder uses VLC tables which are currently stored in large arrays that contain the length of each leaf of the corresponding tree from left to right, taking 15.5KB of space. But all these arrays follow a common pattern: First the entries are ascending and then they are descending with lots of successive entries have the same value. Therefore it makes sense to use a run-length encoding to store them, as this commit does. Notice that the length 16 has to be treated specially because there are arrays with more than 256 consecutive entries with value 16 and because the length of the entries start to descend from this length onward. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sheervideo: Don't leave context in inconsistent state upon errorAndreas Rheinhardt2020-10-10
| | | | | | | | | | | | This has happened if the format changed midstream and if the new packet is so small that it is instantaneously rejected: In this case the VLC tables were for the new format, although the context says that they are still the ones for the old format. It can also happen if the format changed midstream and the allocation of the new tables fails. If the next packet is a packet for the old format, the decoder thinks it already has the correct VLC tables, leading to a segfault. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sheervideo: Inline compile-time constantsAndreas Rheinhardt2020-10-10
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sheervideo: Improve creating VLC tablesAndreas Rheinhardt2020-10-10
| | | | | | | | | Don't needlessly copy an array around; don't create a table with default symbols; and use smaller types to save stack space: The longest code here is 16 bits, so one can store the codes in this type. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/celp_filters: Avoid invalid negation in ff_celp_lp_synthesis_filter()Michael Niedermayer2020-10-10
| | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 25675/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G729_fuzzer-4786580731199488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/takdsp: Fix negative shift in decorrelate_sf()Michael Niedermayer2020-10-10
| | | | | | | | Fixes: left shift of negative value -4 Fixes: 25723/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-6250580752990208 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/parsers: add missing FF_API_NEXT wrappersJames Almer2020-10-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg12dec: Optimize reading mpeg2 intra escape codesAndreas Rheinhardt2020-10-10
| | | | | | | | | | Said escape code is only six bits long, so that one has at least 25 - 6 bits in the bitstream reader's cache after reading it; therefore the whole following 18 bits (containing the actual code) are already in the bitstream reader's cache, making it unnecessary to reload the cache. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/magicyuvenc: Use more correct cast in compare functionAndreas Rheinhardt2020-10-09
| | | | | | | | There is no need to cast const away (even if it was harmless) and to copy the object at all. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/magicyuvenc: Avoid sorting Huffman table unnecessarilyAndreas Rheinhardt2020-10-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mjpegdec: Remove redundant initializationAndreas Rheinhardt2020-10-09
| | | | | | | | | Now that the correct number of codes is used, it is no longer necessary to initialize the lengths of the codes at all any more as the length of the actually used codes is set later anyway. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mjpegdec: Remove use_static from build_vlc()Andreas Rheinhardt2020-10-09
| | | | | | | | | It is always zero; it referred to the INIT_VLC_USE_STATIC flag which has been removed in 595324e143b57a52e2329eb47b84395c70f93087. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mjpegdec: Use correct number of codes when init default VLCsAndreas Rheinhardt2020-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | Commit bbc0d0c1fe2b7ecdc4367295594f084f85ad22f5 made the mjpeg decoder use default Huffman tables when none are given, yet when initializing the default Huffman tables, it did not use the correct number of entries of the arrays used to initialize the tables, but instead it used the biggest entry + 1 (as if it were a continuous array 0..biggest entry). This worked because the ff_init_vlc_sparse() (and its predecessors) always skipped entries with a length of zero and the length of the corresponding elements was always initialized to zero with only the sizes of the actually existing elements being set to a size > 0 lateron. Yet since commit 1249698e1b424cff8e77e6a83cfdbc9d11e01aa7 this is no longer so, as build_vlc() actually read the array containing the values itself. This implies that the wrong length now leads to a read beyond the end of the given array; this could lead to crashs (but usually doesn't); it is detectable by ASAN* and this commit fixes it. *: AddressSanitizer: global-buffer-overflow on address xy ... xy is located 0 bytes to the right of global variable 'avpriv_mjpeg_val_ac_luminance' Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mjpegdec: Use correct number of codes for VLC tablesAndreas Rheinhardt2020-10-08
| | | | | | | | | | | | | | | | | | Commit 1249698e1b424cff8e77e6a83cfdbc9d11e01aa7 made ff_mjpeg_decode_dht() call build_vlc() with a wrong (too hight) number of codes. The reason it worked is that the lengths of the extraneous entries is initialized to zero and ff_init_vlc_sparse() ignores codes with a length of zero. But using a too high number of codes was nevertheless bad, because a) the assert in build_vlc() could have been triggered (namely if the real amount of codes is 256) and b) the loop in build_vlc() uses initialized data (leading to Valgrind errors [1]). Furthermore, the old code spend CPU cycles in said loop although the result won't be used anyway. [1]: http://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-valgrind&time=20201008025137 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* VP9 Profile 2 VDPAU supportManojGuptaBonda2020-10-08
| | | | | | | Added VDPAU to list of supported formats for VP9 420 10 and 12 bit formats. Add VP9 10/12 Bit support for VDPAU Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec/mjpegdec: improve decoding of DNG filesPaul B Mahol2020-10-07
| | | | That have unused symbols coded in DHT.
* avcodec/tiff: do not abort decoding if strips are availablePaul B Mahol2020-10-07
| | | | | | Even if such files are invalid, they can be decoded just fine. Also stored tiles may have bigger dimensions than displayed ones, so do not abort decoding in such cases.
* avcodec: add Cintel RAW decoderPaul B Mahol2020-10-07
|
* avcodec/av1dec: avoid probing with av1decJames Almer2020-10-06
| | | | | | | | av1dec should no longer attempt to output empty frames if another decoder was used for probing and it sucessfully set a pix_fmt ever since 05872c67a4, so we can re-add the AV_CODEC_CAP_AVOID_PROBING cap. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/avs2_parser.c: optimize code stylehwren2020-10-06
| | | | Signed-off-by: hwren <hwrenx@126.com>
* lavc/avs2_parser.c,lavf/davs2.c: add AVS2_* prefixhwren2020-10-06
| | | | | | Add AVS2_* prefix to macro definitions to avoid confusion Signed-off-by: hwren <hwrenx@126.com>
* lavc,doc: add libuavs3d video decoder wrapperhwren2020-10-06
| | | | | Signed-off-by: hbj <hanbj@pku.edu.cn> Signed-off-by: hwren <hwrenx@126.com>
* lavc/avs3_parser: add avs3 parserhwren2020-10-05
| | | | | Signed-off-by: hbj <hanbj@pku.edu.cn> Signed-off-by: hwren <hwrenx@126.com>
* lavc/avs3.h: add AVS3 related definitionshwren2020-10-05
| | | | Signed-off-by: hwren <hwrenx@126.com>
* lavc: add AVS3 codec id and deschwren2020-10-05
| | | | | Signed-off-by: hbj <hanbj@pku.edu.cn> Signed-off-by: hwren <hwrenx@126.com>
* avcodec/h264_slice: use av_buffer_replace() to simplify codeJames Almer2020-10-05
| | | | | | | Based on eff289ce9f030f023e218ee7ce354d4f0e035b6d. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/qsv: Fix leak of options on errorAndreas Rheinhardt2020-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dvenc: Fix undefined left shift of negative numbersAndreas Rheinhardt2020-10-04
| | | | | | | | | The earlier code was based on the assumption that AVFrame.linesize can not be negative. Fixes ticket #8280. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dxtory: Fix negative stride shift in dx2_decode_slice_420()Michael Niedermayer2020-10-04
| | | | | | | | | Fixes: left shift of negative value -640 Fixes: 26044/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5631057602543616 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>
* avcodec/av1dec: partially clean state on frame decoding errorsJames Almer2020-10-04
| | | | | | | | Fixes: member access within null pointer of type 'TileGroupInfo' (aka 'struct TileGroupInfo') Fixes: 25725/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzzer-5166692706287616 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: James Almer <jamrial@gmail.com>
* libwavpackenc: remove libwavpackenc wrapperLynne2020-10-02
| | | | | | | | | The manual states "there is virtually no reason to use that encoder.". It supports less sample formats than the native encoder, is less efficient than the native encoder and is also slower and pretty much remains untested. libwavpack also isn't being fuzzed, which given that we plug the parameters without any sanitizing them looks concerning.
* avcodec/vc1_block: Fix integer overflow in ac valueMichael Niedermayer2020-10-02
| | | | | | | | Fixes: signed integer overflow: 25488 * 87381 cannot be represented in type 'int' Fixes: 24765/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5108259565076480 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: add missing FF_API_TAG_STRING checkJames Almer2020-10-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/options: add missing FF_API_COPY_CONTEXT checksJames Almer2020-10-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libvpxenc: add missing FF_API_ERROR_FRAME checkJames Almer2020-10-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>