summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/nvenc: add hardware config metadataMark Thompson2020-04-27
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* lavc/vaapi_encode: Add hardware config metadataMark Thompson2020-04-26
| | | | These encoders all accept VAAPI surfaces in a hardware frames context.
* lavc/qsvenc: Add hardware config metadataMark Thompson2020-04-26
| | | | | | All of these encoders can accept libmfx surfaces directly in a hardware frames context, or they can accept software frames if a suitable device is supplied to use.
* lavc: Extend hardware config metadata to encodersMark Thompson2020-04-26
|
* lavc: Rename hwaccel.h to hwconfig.hMark Thompson2020-04-26
| | | | | This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
* avcodec/cbs_h265_syntax_template: Check num_negative/positive_pics when ↵Michael Niedermayer2020-04-26
| | | | | | | | | | inter_ref_pic_set_prediction_flag is set Fixes: out of array access Fixes: 20446/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-5707770718584832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/intrax8: Check for end of bitstream in ff_intrax8_decode_picture()Michael Niedermayer2020-04-26
| | | | | | | | Fixes: Timeout (105sec -> 1sec) Fixes: 20479/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5769846937878528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dirac_vlc: Fix integer overflow in ff_dirac_golomb_read_32/16bit()Michael Niedermayer2020-04-25
| | | | | | | | | | | Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int32_t' (aka 'int') Fixes: 21245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5683334274613248 Change to int16_t suggested by Lynne Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/bsf: simplify the codeLimin Wang2020-04-25
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/vp9: prevent null pointer use on init_frames() failurePeter Ross2020-04-25
| | | | | Signed-off-by: Peter Ross <pross@xvid.org> Reviewed-by: James Almer <jamrial@gmail.com>
* avcodec: add support for Cunning Developments' ADPCMZane van Iperen2020-04-24
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mjpeg2jpeg_bsf: Remove unnecessary headerAndreas Rheinhardt2020-04-24
| | | | | | | | | | libavutil/mem.h is unneeded since 33d18982fa03feb061c8f744a4f0a9175c1f63ab, the commit that introduced the new packet-based bsf API, because with this switch the allocations were no longer performed directly, but by av_new_packet(). Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/noise_bsf: Remove unnecessary headersAndreas Rheinhardt2020-04-24
| | | | | | | | | | | | | | | With 33d18982fa03feb061c8f744a4f0a9175c1f63ab, the commit introducing the new packet-based bsf API, a new buffer was no longer allocated directly, but via av_new_packet(), so that libavutil/mem.h was no longer needed. Moreover since commit dc99ee6b08e54de13b4c82ff265609b6ab83e3d8 av_packet_make_writable() is employed which copies the data in case it is unavoidable so that string.h is no longer used (it was used for memcpy()). Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dump_extradata_bsf: Remove unnecessary headerAndreas Rheinhardt2020-04-24
| | | | | | | | | | Since 33d18982fa03feb061c8f744a4f0a9175c1f63ab (the commit that introduced the new bsf API) allocating an enlarged buffer in case extradata needs to be added to a packet is done via av_new_packet(), so that libavutil/mem.h is no longer needed. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dca_core_bsf: Remove unnecessary headerAndreas Rheinhardt2020-04-24
| | | | | | | This bsf never needed libavutil/mem.h. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/chomp_bsf: Remove unnecessary headerAndreas Rheinhardt2020-04-24
| | | | | | | This bsf never needed internal.h. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/vp9_raw_reorder_bsf: Remove unnecessary headerAndreas Rheinhardt2020-04-24
| | | | | | | | | This bsf doesn't have any options, so including libavutil/opt.h is unnecessary. Reviewed-by: Peter Ross <pross@xvid.org> Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavcodec/avpacket: Don't simply forward return value of av_dict_set()Andreas Rheinhardt2020-04-23
| | | | | | | | | | | The documentation of av_dict_set() states that values >= 0 indicate success, whereas av_packet_unpack_dictionary() implies that return values > 0 are impossible. So only forward the return value of av_dict_set() in av_packet_unpack_dictionary() on error. (Btw: av_dict_set() does currently not return values > 0.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/hevc_mp4toannexb_bsf: Check nalu_sizeMichael Niedermayer2020-04-23
| | | | | | | | Fixes: Timeout (29sec -> 5ms) Fixes: 20237/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_MP4TOANNEXB_fuzzer-5165615044362240 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000dec.c: ROI marker supportGautam Ramakrishnan2020-04-23
| | | | | | | | | This patch adds support for decoding images with a Region of Interest. Allows decoding samples such as p0_03.j2k. This patch should fix ticket #4681. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/version: bump minor version for DOVI sidedataJun Zhao2020-04-23
| | | | Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc: add a new sidedata type for DOVIJun Zhao2020-04-23
| | | | | | add a new sidedata type for DOVI. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* mpeg4videoenc: Don't crash with -fsanitize=boundsVitaly Buka2020-04-22
| | | | | | Also the patch makes this code consistent with mpeg4videodec.c Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000dec.c: Support for CRG markerGautam Ramakrishnan2020-04-22
| | | | | | | | This patch adds support to skip the CRG marker. The CRG marker, is an informational marker. Allows samples such as p0_03.j2k to be decoded. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/iff: Check length before memcpy() in decode_deep_rle32()Michael Niedermayer2020-04-22
| | | | | | | | Fixes: out of array read Fixes: 20796/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5111364702175232.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/iff: Fix invalid pointer intermediates in decode_deep_rle32()Michael Niedermayer2020-04-22
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: Pass ret from decode_iccp_chunk()Michael Niedermayer2020-04-20
| | | | | | | Found while reviewing a patch fixing a similar issue Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: update get_nb_samples() docZane van Iperen2020-04-20
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm_ima_{apc, ssi, oki}: replace while() with for()Zane van Iperen2020-04-20
| | | | | | | Per discussion at https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/260854.html Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/qpeg: mark the init function as thread-safe and init cleanup capableJames Almer2020-04-20
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/qpeg: export missing frame propertiesJames Almer2020-04-20
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/qpeg: remove an unnecessary intermediary AVFrameJames Almer2020-04-20
| | | | | | | | | Decoding can be handled directly in the output frame. Also ensure flushing cleans the reference frame in all cases. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/bsf: Use macro for "packet is empty"Andreas Rheinhardt2020-04-20
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc: stop using deprecated av_codec_next()Josh de Kock2020-04-20
| | | | Signed-off-by: Josh de Kock <josh@itanimul.li>
* lavc/hevcdec: fix the HEVC decoder crash when memory over-readqoroliang2020-04-20
| | | | | | | | | | | | Fix an occasional crash for hevc decoder in ARM 32 platform, the root cause is the memory over read(read cross the memory boundary) in SAO NENO functions ff_hevc_sao_band_filter_neon_8 and ff_hevc_sao_edge_filter_neon_8. After this fix, the crash disapper in the massive Android phone test. Signed-off-by: qoroliang <qoroliang@tencent.com>
* avcodec/truehd_core_bsf: Remove unused AVClass pointerAndreas Rheinhardt2020-04-19
| | | | | | | | The context structure of the truehd_core bsf had a pointer to a const AVClass as its first member; yet this bsf does not have any AVClass associated with it, so that this pointer is always NULL. So remove it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/rv40dsp: Fix integer overflows in rv40_weight_func_*()Michael Niedermayer2020-04-19
| | | | | | | | Fixes: signed integer overflow: 40550400 * 128 cannot be represented in type 'int' Fixes: 20331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV40_fuzzer-5676685725007872 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: set return value on av_stereo3d_create_side_data() failurePeter Ross2020-04-18
| | | | | Signed-off-by: Peter Ross <pross@xvid.org> Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* avcodec/bsf: use simplified algorithm for bsf_list chained filteringMarton Balint2020-04-17
| | | | | | Based on the one in ffmpeg.c and it is not using an extra flush_idx variable. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/mv30: use aandcttablesPeter Ross2020-04-17
|
* avcodec/mv30: remove unused table elementsPeter Ross2020-04-17
|
* avcodec/vp3: fix indentationPeter Ross2020-04-17
|
* avcodec: add a WebP parserJames Almer2020-04-16
| | | | | | | | | Based on code from the BMP parser. Addresses ticket #8574 Reviewed-by: James Zern <jzern@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/ac3dec_fixed: Fix several invalid left shifts in scale_coefs()Michael Niedermayer2020-04-16
| | | | | | | | Fixes: left shift of negative value -14336 Fixes: 20298/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5675484201615360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/flac_parser: Do not lose header count in find_headers_search()Michael Niedermayer2020-04-16
| | | | | | | | | | Fixes: Timeout Fixes: out of array access Fixes: 20274/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5649631988154368 Fixes: 19275/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5757535722405888 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/audiodsp: Fix integer overflow in scalarproduct_int16_c()Michael Niedermayer2020-04-16
| | | | | | | | Fixes: signed integer overflow: 2145417478 + 76702564 cannot be represented in type 'int' Fixes: 20313/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_144_fuzzer-5734487724130304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Add explicit capability flag for encoder flushingPhilip Langdale2020-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, there was no way to flush an encoder such that after draining, the encoder could be used again. We generally suggested that clients teardown and replace the encoder instance in these situations. However, for at least some hardware encoders, the cost of this tear down/replace cycle is very high, which can get in the way of some use-cases - for example: segmented encoding with nvenc. To help address that use case, we added support for calling avcodec_flush_buffers() to nvenc and things worked in practice, although it was not clearly documented as to whether this should work or not. There was only one previous example of an encoder implementing the flush callback (audiotoolboxenc) and it's unclear if that was intentional or not. However, it was clear that calling avocdec_flush_buffers() on any other encoder would leave the encoder in an undefined state, and that's not great. As part of cleaning this up, this change introduces a formal capability flag for encoders that support flushing and ensures a flush call is a no-op for any other encoder. This allows client code to check if it is meaningful to call flush on an encoder before actually doing it. I have not attempted to separate the steps taken inside avcodec_flush_buffers() because it's not doing anything that's wrong for an encoder. But I did add a sanity check to reject attempts to flush a frame threaded encoder because I couldn't wrap my head around whether that code path was actually safe or not. As this combination doesn't exist today, we'll deal with it if it ever comes up.
* lavc/jpeg2000dec: Cosmetics, re-indent after last commit.Carl Eugen Hoyos2020-04-15
|
* lavc/jpeg2000dec: Allow to force a compatible pix_fmt.Carl Eugen Hoyos2020-04-15
| | | | | This copies the behaviour of the libopenjpeg decoder. Fixes ticket #5919.
* avcodec/cbs_jpeg_syntax_template: Check array index in huffman_table()Michael Niedermayer2020-04-15
| | | | | | | | Fixes: index 224 out of bounds for type 'uint8_t [224]' Fixes: 21534/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-6291612167831552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>