summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/pnm: Check scaleMichael Niedermayer2020-06-08
| | | | | | | | Fixes: division by zero Fixes: 22974/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PFM_fuzzer-6270027077779456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hevc: move SliceHeader and LongTermRPS back to hevcdec.hAnton Khirnov2020-06-08
| | | | | | | They are no longer necessary there and have nothing to do with parameter sets, so do not belong in hevc_ps.h. This effectively reverts 4aaace8b25.
* hevc_parser: drop the use of SliceHeaderAnton Khirnov2020-06-08
| | | | | It is only used to store a few local variables within one function, which is better accomplished by just declaring them on stack explicitly.
* hevc_refs: reduce code duplication in find_ref_idx()Anton Khirnov2020-06-08
|
* avcodec/v4l2_m2m_enc: Avoid ;;Andreas Rheinhardt2020-06-08
| | | | | | | | | | | | | Inside a function, the second ; in a double ;; is a null statement, but outside of functions a double ;; is simply invalid C that compilers happen to accept. v4l2_m2m_enc.c contained several ;; as a result of macro-expansion. So change the underlying macro so that it doesn't happen any longer. This fixes warnings when compiling with -pedantic: "ISO C does not allow extra ‘;’ outside of a function". Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ac3dec_fixed: Remove some temporary variables from scale_coefs()Michael Niedermayer2020-06-08
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/lzf: Consider the needed size in reallocationMichael Niedermayer2020-06-08
| | | | | | | | Fixes: NULL pointer dereference Fixes: 22381/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-5659879921680384.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/adpcm: XA: Check shift similar to filterMichael Niedermayer2020-06-07
| | | | | | | | Fixes: negative shift Fixes: 22499/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XA_fuzzer-5765452130418688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000_parser: Add jpeg2000 parserGautam Ramakrishnan2020-06-07
| | | | | | | | | | I have attempted to write a JPEG2000 Parser. Have tested by generating a file containing 14 frames, as mentioned by Micheal. Have also tried testing with various packet sizes by setting -frame_size option. Additionally, fixed a few formatting issues as pointed out by Micheal. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/libaomenc: remove the experimental flag when using libaom 2.0.0 or newerJames Almer2020-06-06
| | | | | Reviewed-by: James Zern <jzern@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/huffyuvdec: Test vertical coordinate more oftenMichael Niedermayer2020-06-06
| | | | | | | | | Fixes: out of array access Fixes: 22892/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5135996772679680.fuzz 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>
* libavcodec/bmp_parser.c: fix a use_of_uninitialized_value in target_dec_fuzzer.Thierry Foucu2020-06-06
| | | | | | | the target_dec_fuzzer is checking for the avpkt.data pointer but if the bmp parser cannot combine the frame, the poutbuf is not set. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/mlp_parser.c: fix a use_of_uninitialized_value in target_dec_fuzzer.Thierry Foucu2020-06-06
| | | | | | | the target_dec_fuzzer is checking for the avpkt.data pointer but if the mlp parser cannot combine the frame, the poutbuf is not set. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/png_parser.c: fix a use_of_uninitialized_value in target_dec_fuzzer.Thierry Foucu2020-06-06
| | | | | | | the target_dec_fuzzer is checking for the avpkt.data pointer but if the png parser cannot combine the frame, the poutbuf is not set. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hq_hqa: Check info sizeMichael Niedermayer2020-06-05
| | | | | | | | Fixes: assertion failure Fixes: 21079/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQ_HQA_fuzzer-5737046523248640 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: Fix multiple integer overflows in idct_1d()Michael Niedermayer2020-06-04
| | | | | | | | Fixes: signed integer overflow: -4869937 * 473 cannot be represented in type 'int' Fixes: 21934/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5667289925156864 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: Do not allow MVs outside the allocated imageMichael Niedermayer2020-06-04
| | | | | | | | Fixes: out of array read Fixes: 21804/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5673678898724864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmalosslessdec: Fix integer overflow in mclms_predict()Michael Niedermayer2020-06-04
| | | | | | | | Fixes: signed integer overflow: 2147483636 + 2048 cannot be represented in type 'int' Fixes: 22016/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5109395618004992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp9dsp_template: Fix integer overflow(s) in iadst16_1d()Michael Niedermayer2020-06-04
| | | | | | | | Fixes: signed integer overflow: 1080285923 - -1130879337 cannot be represented in type 'int' Fixes: 22002/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-6260237310099456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Do not allow the sample format to change between channelsMichael Niedermayer2020-06-04
| | | | | | | | | | Fixes: out of array access Fixes: 22692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5678686190960640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: David Bryant <david@wavpack.com> Tested-by: David Bryant <david@wavpack.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/bitpacked: add missing comma to codec tagsMichael Niedermayer2020-06-04
| | | | | | | | | Fixes: array end overread Fixes: 22395/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BITPACKED_fuzzer-5760940300828672 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Darnley <james.darnley@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/nvenc: honor max bitrate in CQ modeRoman Arzumanyan2020-06-04
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/decode: actually propagate AVHWAccel.alloc_frame() return valueJames Almer2020-06-04
| | | | | | | Finishes fixing the regression introduced in a1133db30ef07896afd96f067e5c51531a4e85ab after the partial fix in b6d6597bef66531ec07c07a7125b88aee38fb220. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/ratecontrol: fix the integer overflow after long time runLimin Wang2020-06-03
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/internal: move packet related functions to their own headerJames Almer2020-06-02
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264dec: Disable forced small_padding on flag2 fastMichael Niedermayer2020-06-02
| | | | | | | Fixes: 20978/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5746381832847360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: clear pointer which become stale in get_ppt()Michael Niedermayer2020-06-01
| | | | | | | | | Fixes: use after free Fixes: 22484/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5671488765296640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Gautam Ramakrishnan <gautamramk@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/nvenc: zero avg and max bitrate in CQ modeRoman Arzumanyan2020-06-01
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/encode: Remove ff_alloc_packetAndreas Rheinhardt2020-06-01
| | | | | | | It is no longer used anymore. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg12enc: support mpeg2 encoder const profileLimin Wang2020-06-01
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: add constants for KLV pseudo-profile.Brad Hards2020-05-31
| | | | | | | | | | | | | | | | | There are two different ways KLV is used in MISB specs - sync and async. The corresponding text (in ST1401) says: ISO/IEC 13818-1 Table-34 defines a stream_type = 0x15 for “Metadata carried in PES packets,” and Table 2-22 defines a stream_id = 0xFC for “metadata stream.” and In ISO/IEC 13818-1, Table-34 defines a stream_type = 0x06 for “PES packets containing private data,” and Table 2-22 defines a stream_id = 0xBD for “private_stream_1.” These constants allow us to distinguish the two cases, as codec profiles. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/anm: Don't unnecessarily use context variablesAndreas Rheinhardt2020-05-31
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/anm: Check extradata length before allocating frameAndreas Rheinhardt2020-05-31
| | | | | | | | Then one doesn't need to free the frame in case the length turns out to be insufficient. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: add PFM image decoderPaul B Mahol2020-05-30
|
* avcodec/adpcm_data: extend ff_adpcm_ima_cunning_index_tableMichael Niedermayer2020-05-29
| | | | | | | | Fixes: overread by 1 Fixes: 21880/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_CUNNING_fuzzer-5717917221257216.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libx264: misc style fixesJun Zhao2020-05-28
| | | | | | commit 4ed3a01d717 missed coding style fix. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/decode: fix decoding when frames are allocated using ↵James Almer2020-05-27
| | | | | | | | | AVHWAccel.alloc_frame() Regression since a1133db30ef07896afd96f067e5c51531a4e85ab Found-by: comex <comexk@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/adpcmenc: fix formattingZane van Iperen2020-05-27
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add adpcm_ima_ssi encoderZane van Iperen2020-05-27
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcmenc: add capabilities argument to ADPCM_ENCODER()Zane van Iperen2020-05-27
| | | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264dec: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-05-27
| | | | | | | | | | | then ff_h264_free_tables() and h264_decode_end() can be removed in h264_decode_init() if it's failed. The FF_CODEC_CAP_INIT_CLEANUP flag is need for single thread, For multithread, it'll be cleanup still by AV_CODEC_CAP_FRAME_THREADS flag if have. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-05-27
| | | | | | | | | | then ff_mpv_encode_end() will be unnecessary in ff_mpv_encode_init() if it's failed. The FF_CODEC_CAP_INIT_CLEANUP flag is need for single thread, For multithread, it'll be cleanup still by AV_CODEC_CAP_FRAME_THREADS flag if have. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/adpcmenc: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-05-27
| | | | | | | then we can remove adpcm_encode_close() in adpcm_encode_init() if have failed. so the goto error lable will be unnecessary and can be removed later. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec.h: move avcodec_get_{type,name} to codec_id.hAnton Khirnov2020-05-27
|
* avcodec.h: split AVCodec API into its own headerAnton Khirnov2020-05-27
|
* lavc/vaapi_hevc: add missing max_8bit_constraint_flagLinjie Fu2020-05-27
| | | | | | This is accidentally missed while rebasing. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc/hevc_refs: Fix the logic of find_ref_idx()Xu Guangxin2020-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | Currently find_ref_idx() would trigger 2 scans in DPB to find the requested POC: 1. Firstly, ignore MSB of ref->poc and search for the requested POC; 2. Secondly, compare the entire ref->poc with requested POC; For long term reference, we are able to only check LSB if MSB is not presented(e.g. delta_poc_msb_present_flag == 0). However, for short term reference, we should never ignore poc's MSB and it should be kind of bit-exact. (Details in 8.3.2) Otherwise this leads to decoding failures like: [hevc @ 0x5638f4328600] Error constructing the frame RPS. [hevc @ 0x5638f4328600] Error parsing NAL unit #2. [hevc @ 0x5638f4338a80] Could not find ref with POC 21 Error while decoding stream #0:0: Invalid data found when processing input Search the requested POC based on whether MSB is used, and avoid the 2-times scan for DPB buffer. This benefits both native HEVC decoder and integrated HW decoders. Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc/hevc: Add poc_msb_present filed in LongTermRPSXu Guangxin2020-05-27
| | | | | | | | | | delta_poc_msb_present_flag is needed in find_ref_idx() to indicate whether MSB of POC should be taken into account. Details in 8.3.2. Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* mfenc: Avoid including codecapi.h, fix building in UWP mode with clangMartin Storsjö2020-05-27
| | | | | | | | | | | | | Including codecapi.h and uuids.h in UWP mode doesn't define all defines properly, ending up with constructs that MSVC silently tolerates, but that clang errors out on, like this: DEFINE_GUIDEX(CODECAPI_AVEncCommonFormatConstraint); Just avoid including codecapi.h completely and hardcode the last few enum values we use from there. We already use local versions of most enums from there, due to older mingw-w64 headers being incomplete. Signed-off-by: Martin Storsjö <martin@martin.st>
* mfenc: Remove an unused includeMartin Storsjö2020-05-27
| | | | | | | This might have been used originally for the decoder parts of the MediaFoundation wrapper, which aren't merged yet. Signed-off-by: Martin Storsjö <martin@martin.st>