summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/omx: fix xFramerate calculationAman Gupta2019-09-02
| | | | | | | | | | | Integer overflow in the Q16 framerate calculation was sending invalid values to the OMX encoder. On the RPI4, this manifested as bitrate controls being ignored on video streams with 60000/1001 framerates. Video streams with 30000/1001 framerates were not affected. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/ralf: fix undefined shift in extend_code()Michael Niedermayer2019-09-02
| | | | | | | | Fixes: left shift of negative value -3 Fixes: 16147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5658392722407424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ralf: fix undefined shiftMichael Niedermayer2019-09-02
| | | | | | | | Fixes: left shift of negative value -2 Fixes: 16145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5146671058518016 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: Optimize has_trns codeMichael Niedermayer2019-09-02
| | | | | | | | | | | | | add inner loop specialisations for 2 bpp and 4 bpp These are all cases for which i found testsamples. 30M cycles -> 5M cycles Testcase: fate-rgbapng-4816 Testcase: 16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vcodec/apedec: Fix integer overflow in filter_3800()Michael Niedermayer2019-09-02
| | | | | | | | Fixes: signed integer overflow: 2021654528 + 2032575680 cannot be represented in type 'int' Fixes: 16270/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5732438816325632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/apedec: Fix integer overflow in filter_fast_3320()Michael Niedermayer2019-09-02
| | | | | | | | Fixes: signed integer overflow: -1094994793 * 2 cannot be represented in type 'int' Fixes: 16139/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5663911036059648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/v4l2_m2m: don't close the file descriptor we don't ownPavel Koshevoy2019-09-02
| | | | | | | | | ff_v4l2_m2m_create_context initialized V4L2m2mContext.fd to 0 which is a valid file descriptor value. Next ff_v4l2_m2m_codec_init failed and v4l2_m2m_destroy_context closed file descriptor 0 even though it didn't belong to V4L2m2mContext. Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
* avcodec/bgmc: Check input space in ff_bgmc_decode_init()Michael Niedermayer2019-09-02
| | | | | | | | | Fixes: Infinite loop Fixes: 16608/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5636229827133440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp3: Check for end of input in 2 places of vp4_unpack_macroblocks()Michael Niedermayer2019-09-02
| | | | | | | | | Fixes: Timeout (82sec -> 1sec) Fixes: 16411/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-5166958151991296 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>
* avcodec/tiff: rewrite lut handlingPaul B Mahol2019-09-02
| | | | Remove endianess hack.
* avcodec/tiff: set color_trc, remove sRGB conversionPaul B Mahol2019-09-02
|
* lavc/tiff: Enable decoding of LinearRaw imagesNick Renieris2019-09-02
| | | | | | | | | | | | | "LinearRaw" is a value that the PhotometricInterpretation tag can be set to on DNG images that contain color information for all channels instead of being bayer-encoded ("CFA" value). The DNG decoder is complete enough that we can enable this now. Sample: - http://www.rawsamples.ch/raws/nikon/SCANNER_NIKON_LS5000.DNG Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Default-initialize WhiteLevel DNG tag valueNick Renieris2019-09-02
| | | | | | | | | | | Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification. Also make sure that `BlackLevel < WhiteLevel`. This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Support DNGs with striped (non-tiled) JPEGs imagesNick Renieris2019-09-02
| | | | | | | DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/mjpegdec: Skip unknown APPx marker on bayer imagesNick Renieris2019-09-02
| | | | | | | | Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Decode 10-bit and 14-bit DNG imagesNick Renieris2019-09-02
| | | | | | | 10-bit sample: http://www.rawsamples.ch/raws/phones/RAW_ONEPLUS_ONE-A0001.DNG 14-bit sample: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Support decoding of DNGs with single-component JPEGsNick Renieris2019-09-02
| | | | | | | | This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/mjpegdec: Enable decoding of single-component bayer imagesNick Renieris2019-09-02
| | | | | | | | | Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Force DNG pixel data endianness on an edge caseNick Renieris2019-09-02
| | | | | | | This fixes "X7 RAW" and "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Don't apply strips-related logic to tiled imagesNick Renieris2019-09-02
| | | | Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Fix edge case with full-length/width tilesNick Renieris2019-09-02
| | | | | | | | | When the height is equal to the tile length (full-height tile) after `height % tile_length` is applied with the current code, it results in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's necessary. Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/jpegtables: Handle multiple mappings to the same valueNick Renieris2019-09-02
| | | | | | | | | | | | | | | | | | | Some JPEGs [1] have incorrect DHT entries that map 2 codes to the same value. The second (last) mapping does not ever actually appear in the code stream, therefore ignoring any mappings after the first one fixes this. Without this, an "mjpeg_decode_dc: bad vlc: 0:0" error is thrown. In all known files, the 2 codes are mapped to symbol 0 so only that case is checked. [1]: Embedded JPEGs in "X7 RAW" and "X7 CinemaDNG" samples here: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Apply color scaling to uncompressed DNGsNick Renieris2019-09-02
| | | | Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Convert DNGs to sRGB color spaceNick Renieris2019-09-02
| | | | Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Decode embedded JPEGs in DNG imagesNick Renieris2019-09-02
| | | | | | | | | | | | | | | | Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder. This commit adds support for: - DNG tiles - DNG tile huffman lossless JPEG decoding - DNG 8-bpp ("packed" as dcraw calls it) decoding - DNG color scaling [1] - LinearizationTable tag - BlackLevel tag [1]: As specified in the DNG Specification - Chapter 5 Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGsNick Renieris2019-09-02
| | | | | | | | | | | Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG. Tested for ljpeg regressions with: `ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi` `ffmpeg test.avi out.avi` The modified code in ljpeg_decode_rgb_scan runs without issues. Signed-off-by: Nick Renieris <velocityra@gmail.com>
* avcodec: Support EBU Tech. 3213-E primaries valuesRaphaël Zumer2019-09-01
| | | | | Signed-off-by: Raphaël Zumer <rzumer@tebako.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/truemotion2: Fix multiple integer overflows in tm2_null_res_block()Michael Niedermayer2019-08-31
| | | | | | | | Fixes: signed integer overflow: 1795032576 + 598344192 cannot be represented in type 'int' Fixes: 16196/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5636723419119616 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1_block: Check the return code from vc1_decode_p_block()Michael Niedermayer2019-08-31
| | | | | | | | | Fixes: left shift of negative value -1 Fixes: 16424/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5656579055026176 Fixes: 16358/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5714436358144000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: Require res_sprite for wmv3imagesMichael Niedermayer2019-08-31
| | | | | | | | | | | non res_sprite leads to decoder delay which leads to assertion failure Fixes: Assertion failure Fixes: 16402/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5704510034411520 Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int' Fixes: 16425/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5692858838810624 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1_block: Check for double escapesMichael Niedermayer2019-08-31
| | | | | | | | Fixes: out of array read Fixes: 16331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5672735195267072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vorbisdec: Check get_vlc2() failureMichael Niedermayer2019-08-30
| | | | | | | | Fixes: out of array read Fixes: 16510/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VORBIS_fuzzer-5754510382727168 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_encode: Simplify code with av_clip_int8()Michael Niedermayer2019-08-30
| | | | | Reviewed-by: "Li, Zhong" <zhong.li@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add IMM5 decoderPaul B Mahol2019-08-29
|
* avcodec/msrle: add a flush() callbackPaul B Mahol2019-08-29
| | | | The reference frame isn't valid after seeking.
* avcodec/ivi: Allocate bufs laterMichael Niedermayer2019-08-29
| | | | | | | | Fixes: Timeout (24sec->2sec) Fixes: 15951/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5095433266790400 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tta: Fix integer overflow in predictionMichael Niedermayer2019-08-29
| | | | | | | | Fixes: signed integer overflow: -395281576 + -1827578048 cannot be represented in type 'int' Fixes: 16038/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5646109705240576 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vb: Check input packet size to be large enough to contain flagsMichael Niedermayer2019-08-29
| | | | | | | | Fixes: Timeout (->9sec) Fixes: 16292/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VB_fuzzer-5747063496638464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Limit the number of access units per packet to 2Michael Niedermayer2019-08-29
| | | | | | | | Fixes: Timeout (122sec -> 13ms) Fixes: 15978/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5148925004087296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/cbs_h2645: Use av_realloc instead of av_mallocThierry Foucu2019-08-28
| | | | | Follow the description of av_realloc, the memory needs to be allocated by av_realloc.
* avcodec/dsd: use uint8_t instead of unsigned charPaul B Mahol2019-08-28
|
* avcodec/dsddec: add slice threading supportPaul B Mahol2019-08-28
|
* avcodec/h264_refs: do not use invalid mmco values in case of errorPaul B Mahol2019-08-28
| | | | Change one relevant assert to av_assert0 while here.
* avcodec/tiff: add missing break in tiff_decode_tag()Paul B Mahol2019-08-28
|
* libavcodec/amfenc: Vulkan initialization support for encoder.OvchinnikovDmitrii2019-08-27
| | | | | | | | | | | | | | | | | | Added linux support for amf encoder through vulkan. To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro package(amdgru-pro contains, but does not install automatically) are required. This driver can be installed using amdgpu-pro-install script in official amd driver archive. Initialization of amf encoder occurs in this order: 1) trying to initialize through dx11(only windows) 2) trying to initialize through dx9(only windows) 3) trying to initialize through vulkan Only Vulkan initialization available on linux.
* avcodec/qtrle: don't clear the palette when flushingJames Almer2019-08-27
| | | | | | It may be propagated only once for the entire stream. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/qtrle: call ff_reget_buffer() only when the picture data is going to ↵James Almer2019-08-27
| | | | | | | | | | | | | | change ff_reget_buffer() will attempt to create a writable copy of the frame, which is not needed when the decoder intends to return a reference to the same buffer as the previous frame. Should reduce data copy, hopefully achieving a similar speed up as a9dacdeea6168787a142209bd19fdd74aefc9dd6 without dropping frames. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* Revert "avcodec/qtrle: Do not output duplicated frames on insufficient input"James Almer2019-08-27
| | | | | | | | | | | This reverts commit a9dacdeea6168787a142209bd19fdd74aefc9dd6. This patch effectively made the decoder output vfr content out of samples where cfr is expected. Addresses ticket #7880. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/atrac9dec: Check block_alignMichael Niedermayer2019-08-27
| | | | | | | | | Fixes: Infinite loop Fixes: 16260/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5676365617037312 Fixes: 16260/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5768093879500800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/qtrle: add a flush() callbackJames Almer2019-08-27
| | | | | | | The reference frame isn't valid after seeking Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>