aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* libavcodec/alsdec.c: Add check for av_malloc_array() and av_calloc()HEADmasterJiasheng Jiang14 hours1-2/+6
| | | | | | | | | Add check for the return value of av_malloc_array() and av_calloc() to avoid potential NULL pointer dereference. Fixes: dcfd24b10c ("avcodec/alsdec: Implement floating point sample data decoding") Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/nvdec: switch to proper pixfmts on next major bumpTimo Rothenpieler41 hours3-0/+26
|
* avcodec/nvenc: add support for new 10 bit MSB pixel formatsTimo Rothenpieler41 hours1-12/+21
|
* avcodec/mpegvideo_dec: Avoid implicit NULL + offsetAndreas Rheinhardt44 hours2-32/+33
| | | | | | | | | Happens since 4fc874ef0813d39983f9b634cec42798aa94b57a when this code is called via error resilience. Also do the same for wmv2dec.c. Fixes the vsynth_{1,2,3,_lena}-mpeg4-error and wmv2-drm-dec FATE-tests. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/opus/dec: Simplify resetting AVAudioFifoAndreas Rheinhardt44 hours1-3/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/opus/dec: Don't call function multiple times in FFMAXAndreas Rheinhardt44 hours1-1/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/opus/dec: Remove unused parametersAndreas Rheinhardt44 hours1-5/+2
| | | | | | | | The parameters here are not only unused, but buf_size's value is actually wrong when flushing (it comes from the subpacket of the last packet sent and is therefore outdated). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/get_bits: Remove GetBitContext.buffer_endAndreas Rheinhardt44 hours1-5/+1
| | | | | | | | | | | It is unused. Furthermore, this automatically fixes the issue that init_get_bits() failure would lead to NULL + 0 (when setting buffer_end) which is UB before C23. This happened in the fic-avi and fic-avi-skip_cursor FATE-tests. This saved 7296B of .text here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/get_bits: Add get_bits_bytesize()Andreas Rheinhardt44 hours8-11/+38
| | | | | | And use it to avoid accesses to GetBitContext.buffer_end. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vvc/dec: Don't use GetBit-API when byte-alignedAndreas Rheinhardt44 hours1-13/+16
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/bytestream: Add const where appropriateAndreas Rheinhardt44 hours1-8/+8
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: squelch uninitialized variable warningsPeter Ross3 days1-0/+4
| | | | | | Fixes CID1655273 and CID1655274. Signed-off-by: Marvin Scholz <epirat07@gmail.com>
* avcodec: bump minor after adding AV_PKT_DATA_RTCP_SRMarvin Scholz6 days1-1/+1
|
* avcodec: add AV_PKT_DATA_RTCP_SR side data typeMarvin Scholz6 days2-0/+7
|
* lavf: add and use AVRTCPSenderReport structMarvin Scholz6 days1-0/+14
| | | | This will be used in a future commit to expose the SR as side-data.
* avcodec/vvc/ctu: Check ff_vvc_num_signalled_palette_entriesMichael Niedermayer7 days1-1/+1
| | | | | | | | Fixes: index 107 out of bounds for type 'uint16_t const[63]' Fixes: 421336912/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6436225806565376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vvc/ctu: Check palette_escape_valMichael Niedermayer7 days1-0/+2
| | | | | | | | Fixes: integer overflow Fixes: 418314174/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4871731867353088 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/psd: Move frame allocation after RLE processingMichael Niedermayer7 days1-3/+3
| | | | | | | | Fixes: Timeout Fixes: 410609448/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PSD_fuzzer-6267226128973824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/apv_dsp: Avoid UB overflow in dequantMichael Niedermayer7 days1-2/+2
| | | | | | | | Fixes: signed integer overflow: 33632416 * 64 cannot be represented in type 'int' Fixes: 421817631/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-4957386534354944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/smacker: Check input before allocationMichael Niedermayer7 days1-0/+4
| | | | | | | | Fixes: Timeout Fixes: 421650030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-6144441767493632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/smacker: Move buffer allocation to laterMichael Niedermayer7 days1-4/+6
| | | | | | | | Reduces allocations on random input Fixes: 421650030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-6144441767493632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/opus: don't materialize buf pointer from nullKacper Michajłow8 days1-0/+3
| | | | | | | Fixes: avcodec/opus/dec.c: runtime error: applying non-zero offset 10 to null pointer Signed-off-by: Kacper Michajłow <kasper93@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/nvdec: fix 10bit output pixel formatsTimo Rothenpieler9 days1-2/+12
| | | | Fixes #11655
* avcodec/adpcm: Sanyo LD-ADPCM decoderPeter Ross9 days6-2/+212
|
* avcodec/rv60dec: Check ofs for overflowsMichael Niedermayer9 days1-1/+3
| | | | | | | | Fixes: signed integer overflow: 30 + 2147483647 cannot be represented in type 'int' Fixes: 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-6568264620900352 Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/sunrast: fix leak in sunrast_decode_frame()Lidong Yan9 days1-1/+3
| | | | | | | | | | In sunrast_decode_frame(), we use av_malloc_array() allocates memory to ptr and ptr2. However if buf_end - buf < 1, this function returns error code without freeing this memory thus cause a leak. Add av_freep() before return. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rv34: Fix spelling mistakeAndreas Rheinhardt10 days1-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rv34: Don't report progress unnecessarilyAndreas Rheinhardt10 days1-4/+0
| | | | | | ff_mpv_frame_end() already does it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move loop_filter to {H263Dec,MPVEnc,VC1}ContextAndreas Rheinhardt10 days21-45/+47
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move partitioned_frame to {H263Dec,MPVEnc}ContextAndreas Rheinhardt10 days7-20/+21
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg_er: Allow to skip setting partitioned_frame, p[pb]_timeAndreas Rheinhardt10 days4-5/+12
| | | | | | | | | | | Instead of setting these unconditionally (they are always zero for H.261, MPEG-1/2, RV30/40, VC-1), add a variant of ff_mpeg_er_frame_start() that sets them and remove setting them from ff_mpeg_er_frame_start(). Also pass these values via parameters instead of reading them from the MPVContext itself. This will allow to move them from MPVContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move fields to {H263Dec,MPVEnc}Context when possibleAndreas Rheinhardt10 days25-151/+162
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/flvdec: Binarize h263_flvAndreas Rheinhardt10 days3-4/+3
| | | | | | | | | It used to be a tri-state encoding both whether to use FLV picture headers and whether to use the FLV way of encoding escape values, but the former is now unnecessary due to the switch to a function pointer for reading the header. So binarize h263_flv. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263enc: Inline value of h263_flvAndreas Rheinhardt10 days3-10/+5
| | | | | | It is always two when we encode FLV1. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Use function ptr for decode_picture_headerAndreas Rheinhardt10 days8-30/+22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/msmpeg4dec: Move ff_msmpeg4_decode_init() downAndreas Rheinhardt10 days1-39/+40
| | | | | | Will avoid a forward declaration lateron. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move SLICE_* defs to h263dec.h, h261dec.cAndreas Rheinhardt10 days3-5/+8
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move mb_skip_run to {RV34Dec,MPVEnc}ContextAndreas Rheinhardt10 days8-22/+25
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12dec: Put mb_skip_run on the stackAndreas Rheinhardt10 days1-12/+11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move mb_num_left to {H263,RV34}DecContextAndreas Rheinhardt10 days7-13/+16
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move fields only used by H.263 decoders to H263DecCtxAndreas Rheinhardt10 days10-80/+86
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12dec: Don't use MPVContext.blockAndreas Rheinhardt10 days4-43/+23
| | | | | | | Instead add the necessary blocks directly into Mpeg12SliceContext. This allows to completely remove MPVContext.block. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12dec: Move MpegEncContext.gb to Mpeg12SliceContextAndreas Rheinhardt10 days2-107/+104
| | | | | | It was its last user. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Add missing headersAndreas Rheinhardt10 days11-2/+11
| | | | | | | These files currently rely on implicit inclusions of avassert.h and/or mathops.h via get_bits.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12dec: Add Mpeg12SliceContextAndreas Rheinhardt10 days3-430/+436
| | | | | | | This is in preparation for removing the GetBitContext from MPVContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Stop using MpegEncContext.gbAndreas Rheinhardt10 days13-583/+588
| | | | | | | | Add a GetBitContext to H263DecContext instead. This is in preparation for removing MpegEncContext.gb. Also move last_resync_gb to H263DecContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Don't use MpegEncContext.blockAndreas Rheinhardt10 days7-23/+26
| | | | | | | | Instead add the necessary blocks directly to H263DecContext (only six are needed, not 12 as ff_mpv_common_init() currently allocates). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Remove redundant block parameter from decode_mbAndreas Rheinhardt10 days7-22/+21
| | | | | | | | | | | With the exception of mpeg4_decode_studio_mb(), all decode_mb functions implicitly presumed that the block provided as argument coincides with MpegEncContext.block (they zeroed the latter and then used the former to decode the block); mpeg4_decode_studio_mb() meanwhile did not use the provided block at all (it uses blocks of int32_t). So remove said parameter. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Add H263DecContextAndreas Rheinhardt10 days21-2223/+2251
| | | | | | | | | This is in preparation for moving the fields only used by H.263-based decoders from MPVContext to H263DecContext. For now only the decode_mb function pointer has been moved (to be able to switch said callback to use an H263DecContext*). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move dct_precision to Mpeg4DecContextAndreas Rheinhardt10 days3-12/+15
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>