summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/(h263|mpeg4?video)_parser: Make *_find_frame_end() staticAndreas Rheinhardt2021-09-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc: deprecate AV_CODEC_(FLAG|CAP)_TRUNCATEDAnton Khirnov2021-09-20
| | | | | | | | | | It is supported only by a few decoders (h263, h263p, mpeg(1|2|)video and mpeg4) and is entirely redundant with parsers. Furthermore, using it leads to missing frames, as flushing the decoder at the end does not work properly. Co-authored-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move startcodes to mpeg12.hAndreas Rheinhardt2021-09-20
| | | | | | | And remove the MPEG-4-specific SLICE_START_CODE, which duplicates SLICE_STARTCODE. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snowdec: Maintain avmv bufferMichael Niedermayer2021-09-19
| | | | | | | | | | | This avoids reallocating per frame Fixes: Assertion failure Fixes: 36359/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6733238591684608 Fixes: 38623/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6098656512573440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/siren: Check index for catergory5Michael Niedermayer2021-09-19
| | | | | | | | | Fixes: out of array access Fixes: 38603/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSNSIREN_fuzzer-5741847809490944.fuzz 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/mpeg12dec: Do not put mpeg_f_code into an invalid state on error returnMichael Niedermayer2021-09-17
| | | | | | | | Fixes: invalid shift Fixes: 37018/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-5290280902328320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegvideo_enc: Limit bitrate tolerance to the representableMichael Niedermayer2021-09-17
| | | | | | | Fixes: error: 1.66789e+11 is outside the range of representable values of type 'int' Fixes: Ticket8201 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmaprodec: Check that the EOF frame was allocated before decoding ↵Michael Niedermayer2021-09-17
| | | | | | | | | | | into it Fixes: NULL pointer dereference Fixes: 38125/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5151909422432256 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/elbg: Remove avoidable bufferAndreas Rheinhardt2021-09-17
| | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/apedec: Fix integer overflow in intermediateMichael Niedermayer2021-09-16
| | | | | | | | Fixes: signed integer overflow: 559334865 * 4 cannot be represented in type 'int' Fixes: 37929/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6751932295806976 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mjpegdec: export display matrix frame side data when availableJames Almer2021-09-16
| | | | | | Finishes fixing ticket #6945. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/elbg: Increase some fields to 64bitMichael Niedermayer2021-09-15
| | | | | | | Fixes: Ticket8312 Fixes: Ticket8321 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxva2_av1: fix superres_denom parameterTong Wu2021-09-14
| | | | | | | | Defined in spec 5.9.8. When superres is enabled, SuperresDenom equals "coded_denom + SUPERRES_DENOM_MIN" instead of coded_denom. Signed-off-by: Tong Wu <tong1.wu@intel.com> Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* avcodec/h264_picture: wait for the second slice to apply film grain on ↵James Almer2021-09-14
| | | | | | | | | | interlaced content Fixes: Assertion failure Fixes: clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6581961297100800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/exr: Fix undefined integer multiplicationMichael Niedermayer2021-09-14
| | | | | | | | Fixes: signed integer overflow: 7020950083487072256 * 2 cannot be represented in type 'long long' Fixes: 37523/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5133634955771904 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000_parser: Check state!=0Michael Niedermayer2021-09-14
| | | | | | | | | Fixes: out of array read Fixes: 37664/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5893420460146688 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/bsf: Unref the packet when flushingAndreas Rheinhardt2021-09-14
| | | | | | | | The documentation does not require the packet to be blank in this case (i.e. it can now contain opaque_ref), but it does contain that the contents will be reset upon success. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/bsf: Use null-bsf for passthrough when availableAndreas Rheinhardt2021-09-14
| | | | | | | | When an empty list bsf is used for passthrough, there is a check for every packet in bsf_list_filter() before ff_bsf_get_packet_ref() is called. Directly using the null bsf avoids that. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmadec: fix WMA gapless playbackbnnm2021-09-12
| | | | | | | | | | | | | Fixes trac issue #7473. Removes encoder delay (skip samples) and writes remaining frame samples after EOF to get correct sample count. Output is now accurate vs players that use Microsoft's codecs (Windows Media Format Runtime). Tested vs encode>decode WMAv2 with MS's codecs and most sample rate/bit rate/channel/mode combinations in ASF/XWMA. WMAv1 appears to use the same delay, from FFmpeg samples. Signed-off-by: bnnm <bananaman255@gmail.com>
* avcodec/h274: trim unnecessarily large arrayNiklas Haas2021-09-12
| | | | | | We only ever read to idx+3, so 256 values are overkill. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h274: don't read from uninitialized array membersNiklas Haas2021-09-12
| | | | | | | | | | | | This bug flew under the radar because, in practice, these values are 0-initialized for the first invocation. But for subsequent invocations (with different h/v values), reading from the uninitialized parts of `out` is undefined behavior. Avoid this by simply adjusting the iteration range of the following loops. Has the added benefit of being a minor speedup. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/qsv_enc: do not reuse enc_ctrl from previous framesXu Guangxin2021-09-09
| | | | | | | | | fixes #8857 If we do not clear the enc_ctrl, we will reuse previous frames' data like FrameType. Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mlpenc: Fix mixed declarations and code warningAndreas Rheinhardt2021-09-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/siren: decode_vector: remove unused parameterPeter Ross2021-09-09
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Peter Ross <pross@xvid.org>
* avcodec/siren: replace magic numbers with macro valuePeter Ross2021-09-09
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Peter Ross <pross@xvid.org>
* avcodec/libvpxenc: Apply codec options to alpha codec contextAdam Chelminski2021-09-08
| | | | | | | | | | | | | | | | | When encoding yuva420 (alpha) frames, the vpx encoder uses a second vpx_codec_ctx to encode the alpha stream. However, codec options were only being applied to the primary encoder. This patch updates codecctl_int and codecctl_intp to also apply codec options to the alpha codec context when encoding frames with alpha. This is necessary to take advantage of libvpx speed optimizations such as 'row-mt' and 'cpu-used' when encoding videos with alpha. Without this patch, the speed optimizations are only applied to the primary stream encoding, and the overall encoding is just as slow as it would be without the options specified. Signed-off-by: Adam Chelminski <chelminski.adam@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* avcodec/iirfilter: Make ff_iir_filter_flt() staticAndreas Rheinhardt2021-09-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow_dwt: Make ff_snow_(horizont|vertic)al_compose97i staticAndreas Rheinhardt2021-09-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/jpeg2000: Make ff_tag_tree_size() staticAndreas Rheinhardt2021-09-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mqcenc: Make ff_mqc_flush() staticAndreas Rheinhardt2021-09-08
| | | | | | | Only used as an auxiliary function for ff_mqc_flush_to() since 4624656797b667eb6405186682eb04e74dfd90fd. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/qsv: Make ff_qsv_map_error() staticAndreas Rheinhardt2021-09-08
| | | | | | It is only an auxiliary function to ff_qsv_print_(error|warning)(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Make ff_h263_hw_config_list staticAndreas Rheinhardt2021-09-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs: Make ff_cbs_alloc_unit_data() staticAndreas Rheinhardt2021-09-08
| | | | | | Forgotten in 7c92eaace2b338e0b3acc18e1543b365610578fd. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/bsf: ff_list_bsf staticAndreas Rheinhardt2021-09-08
| | | | | | | | It is a special BSF that is only available via the av_bsf_list-API; it is not part of the list generated from the declarations in bitstream_filters.c and therefore needn't have external linkage. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavcodec/qsv: enabling d3d11va support, added mfxhdlpairArtem Galin2021-09-08
| | | | | | | | | Adding DX11 relevant device type checks and adjusting callbacks with proper MediaSDK pair type support. Extending structure for proper MediaSDK pair type support. Signed-off-by: Artem Galin <artem.galin@intel.com>
* avcodec/h264_parser: Fix nalsize checkMichael Niedermayer2021-09-08
| | | | | | | | Fixes: Assertion failure Fixes: 37463/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4914693494931456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mlpenc: simplify some complicated expressions morePaul B Mahol2021-09-07
|
* avcodec/mlpenc: simplify strange pointer initializationsPaul B Mahol2021-09-07
|
* avcodec/mlpdec: fix integer sanitizer warning under clangPaul B Mahol2021-09-07
| | | | | Fixes: libavcodec/mlpdec.c:1108:37: runtime error: negation of 1 cannot be represented in type 'unsigned int'
* avcodec/siren: MSN Siren decoderPeter Ross2021-09-07
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Peter Ross <pross@xvid.org>
* avcodec/mlpenc: remove convoluted incomplete multiple substreams support codePaul B Mahol2021-09-07
| | | | | It is very hard to follow data structures indirections in current code, so just remove it for now.
* avcodec/mlpenc: use variables local to for loopsPaul B Mahol2021-09-07
|
* avcodec/nvenc: add constrainedFrame encoding supportLimin Wang2021-09-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add single slice intra refresh supportLimin Wang2021-09-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add intra refresh supportLimin Wang2021-09-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: make number of slices per frame configurableLimin Wang2021-09-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/jpeg2000dec: Check that atom header is within bytsetreamMichael Niedermayer2021-09-05
| | | | | | | | | Fixes: Infinite loop Fixes: 36666/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5912760671141888 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/apedec: Fix 2 integer overflows in filter_3800()Michael Niedermayer2021-09-05
| | | | | | | | | Fixes: signed integer overflow: 1683879955 - -466265224 cannot be represented in type 'int' Fixes: 37419/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6074294407921664 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/xpmdec: Move allocations down after more error checksMichael Niedermayer2021-09-05
| | | | | | | | | Fixes: Timeout Fixes: 37035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XPM_fuzzer-5142718576721920 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/argo: Move U, fix shiftMichael Niedermayer2021-09-05
| | | | | | | | | Fixes: left shift of 255 by 24 places cannot be represented in type 'int' Fixes: 37249/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5754862984888320 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>