summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* lavc/codec_par: add AVCodecParameters.framerateAnton Khirnov2023-05-073-1/+16
| | | | This corresponds to AVCodecContext.framerate.
* avcodec/adpcm: Fix integer overflow in intermediate in ADPCM_XMDMichael Niedermayer2023-05-061-2/+2
| | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 2140143616 + 254665816 cannot be represented in type 'int' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XMD_fuzzer-6690181676924928 As a sideeffect this simplifies the equation, the high bits are different after this but only the low 16bits are stored and used in later steps. 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/dpcm: fix undefined interger overflow in wadyMichael Niedermayer2023-05-061-1/+1
| | | | | | | | Fixes: signed integer overflow: -2147375930 + -133875 cannot be represented in type 'int' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WADY_DPCM_fuzzer-6703727013920768 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tiff: add a zero DNG_LINEARIZATION_TABLE checkMichael Niedermayer2023-05-061-1/+1
| | | | | | | | | Fixes: index 4294967295 out of bounds for type 'uint16_t [65536]' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5950405086674944 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6666195176914944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tak: Check remaining bits in ff_tak_decode_frame_header()Michael Niedermayer2023-05-061-0/+3
| | | | | | | | Fixes: out of array access Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-6682195323650048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/sonic: Fix two undefined integer overflowsMichael Niedermayer2023-05-061-2/+2
| | | | | | | | | Fixes: signed integer overflow: 2147483372 - -148624 cannot be represented in type 'int' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5477177805373440 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-6681622236233728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: the IFF_ILBM implementation assumes that there are a multiple ↵Michael Niedermayer2023-05-061-1/+1
| | | | | | | | | | | of 16 allocated Fixes: out of array access Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5124452659888128 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-6362836707442688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/flacdec: Fix signed integre overflowMichael Niedermayer2023-05-061-1/+1
| | | | | | | | Fixes: signed integer overflow: 3011809745540902265 + 6323452730883571725 cannot be represented in type 'long' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-6687553022722048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/exr: Cleanup befor returnMichael Niedermayer2023-05-061-6/+12
| | | | | | | | Fixes: leaks Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6703454090559488 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: Do not pass AVFrame into global header decodeMichael Niedermayer2023-05-061-1/+6
| | | | | | | | | | | The global header should not contain a frame, and decoding it would result in leaks Fixes: memleak Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-6603443149340672 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: remove AVFrame argument from decode_iccp_chunk()Michael Niedermayer2023-05-061-2/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pdvdec: Check previous frame before using itMichael Niedermayer2023-05-061-1/+1
| | | | | | | | | Fixes: load of null pointer of type 'uint8_t' (aka 'unsigned char') Fixes: 58256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PDV_fuzzer-4776436325285888 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/libdav1d: support parsing multiple ITU-T T.35 entries in a pictureJames Almer2023-05-051-2/+11
| | | | | | This requires the newest libdav1d release. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/tak: do not store invalid values in stream infoAnton Khirnov2023-05-051-7/+13
| | | | | | | | | | When tak_get_nb_samples() fails, it will currently write AVERROR_INVALIDDATA as TAKStreamInfo.frame_samples. The parser will then use this negative value as a frame duration, which leads to various breakage. Avoid this by returning the error code from tak_parse_streaminfo() directly; never store negative values in the parsed header.
* lavc/tak: make ff_tak_parse_streaminfo staticAnton Khirnov2023-05-052-5/+3
| | | | It is not used outside of tak.c
* avutil/frame: deprecate key_frameJames Almer2023-05-042-0/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-04160-243/+371
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: deprecate interlaced_frame and top_field_firstJames Almer2023-05-042-0/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: use the new AVFrame interlace flags in all decoders and encodersJames Almer2023-05-0434-107/+130
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/options_table: reorder nokey after nointraZhao Zhili2023-05-041-1/+1
| | | | | | So the values are in ascending order. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/hevcdec: remove unused variables from hls_slice_dataZhao Zhili2023-05-041-8/+4
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/avcodec: fix UB NULL+0Zhao Zhili2023-05-041-2/+3
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* lavf/dv: use a more granular timebase for audioAnton Khirnov2023-05-021-0/+3
| | | | | | | | | | | | | One that is fine enough to represent all DV audio sample rates. Audio packet durations are now sample-accurate. This largely undoes commit 76fbb0052df471075858c1cb82b04c8be7adba8d. To avoid breaking the issue fixed by that commit, resync audio timestamps against video if they get more than one frame apart. The sample from issue #8762 still works correctly after this commit. Slightly changes the results of the lavf-dv seektest, due to the audio timebase being more granular.
* lavf/dv: do not set video timebase more than onceAnton Khirnov2023-05-021-0/+3
| | | | | | | | | | | | | Current code will call avpriv_set_pts_info() for each video frame, possibly setting a different timebase if the stream framerate changes. This violates API conventions, as the timebase is supposed to stay constant after stream creation. Change the demuxer to set a single timebase that is fine enough to handle all supported DV framerates. The seek tests change slightly because the new timebase is more granular.
* avcodec/hevc_ps: check for out of range bitdepth in SPSJames Almer2023-04-301-2/+12
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevc_ps: Avoid signed overflow before check on QPMichael Niedermayer2023-05-011-3/+3
| | | | | | | | Fixes: signed integer overflow: -2147483648 - 5 cannot be represented in type 'int' Fixes: 58066/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5312995835379712 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevc_ps: Check depth to be within 8 to 16Michael Niedermayer2023-05-011-0/+4
| | | | | | | | Fixes: assertion failure in bitreader Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-627318668066816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavarc: Check order before using it to write the listMichael Niedermayer2023-05-011-0/+2
| | | | | | | | | | | Fixes: out of array access Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6247711015043072 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6487578428964864 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6651587794960384 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6686265824378880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/bonk: decode multiple passes in intlist_read() at onceMichael Niedermayer2023-05-011-6/+11
| | | | | | | | | | | This makes the worst case much faster Fixes: Timeout Fixes: 51363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-5660734784143360 Fixes: 57957/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-5874095467397120 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: Check bits left before picture allocationMichael Niedermayer2023-05-011-0/+3
| | | | | | | | Fixes: Timeout Fixes: 57893/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5091726540013568 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: Factor constant sign out of loop in long_filter_high_3800()Michael Niedermayer2023-05-011-3/+14
| | | | | | 930 -> 850 cycles Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/apedec: Move pointer instead of copying each element in delay in ↵Michael Niedermayer2023-05-011-6/+9
| | | | | | | | long_filter_high_3800() ~1000 -> 930 cycles Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevc_ps: use get_ue_golomb() for some SPS Screen Content Coding ↵James Almer2023-04-303-9/+16
| | | | | | | | | extension fields Also remove the _minus1 part of the name to be in line with the rest of the decoder. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/parser: fill avctx dimensions if unsetJames Almer2023-04-301-0/+4
| | | | | | | This allows the usage of codecs in builds that have a parser but no decoders for remuxing scenarios with raw sources. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevc_ps: use get_{ue,se}_golomb() for some PPS Range extension fieldsJames Almer2023-04-281-7/+7
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevc_ps: use get_ue_golomb() for some PPS Screen Content Coding ↵James Almer2023-04-282-10/+17
| | | | | | | | | | extension fields Also remove the _minus8 part of the name to be in line with the rest of the decoder, and fix the storage type for pps_palette_predictor_initializer, to support hbd values. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/smacker: do not use NULL for av_log()Paul B Mahol2023-04-271-11/+11
|
* avcodec/interplayacm: do not use NULL for av_log()Paul B Mahol2023-04-271-3/+5
|
* avcodec/mjpegdec: support more pixel formatsCarl Eugen Hoyos2023-04-241-0/+42
| | | | | | | | Support pixel formats 0x11412100, 0x11311100, and 0x41211100, and add logic to perform 4x horizontal upsampling. This should fix various JPEG files found in Ticket #8930. Co-authored-by: <leo.izen@gmail.com>
* lavu/hwcontext_qsv: Update after adding support for VAAPI on WindowsSil Vilerino2023-04-241-3/+2
| | | | | | | | | | | | | - qsv_internal.h: Remove unnecessary include va_drm.h - qsv_internal.h: Enable AVCODEC_QSV_LINUX_SESSION_HANDLE on Linux/VA only - hwcontext_qsv.c: Do not allow child_device_type VAAPI for Windows until support is added, keep D3D11/DXVA2 as more prioritary defaults. Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/ Signed-off-by: Sil Vilerino <sivileri@microsoft.com> Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
* avcodec/jpeg2000dec: add support for HTJ2K block decodingcaleb2023-04-225-19/+1539
| | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
* avcodec/jpeg2000dec: move decoder structs to a header filecaleb2023-04-222-87/+120
| | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
* avcodec/vorbisdec: Check codebook float values to be finiteMichael Niedermayer2023-04-221-0/+4
| | | | | | | Fixes: Timeout Fixes: 55116/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VORBIS_fuzzer-4572159970508800 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/g2meet: Replace fake allocation avoidance for framebufMichael Niedermayer2023-04-221-9/+10
| | | | | | | | | | | | framebuf is only allocated when the new width/height are larger than the old but nothing sets the old so its always allocated. Use av_fast_mallocz() instead. Fixes: Timeout Fixes: 55094/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5116909932904448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevcdec: further constrain some slice header field valuesJames Almer2023-04-222-5/+11
| | | | | | | | num_ref_idx_l0_active_minus1, num_ref_idx_l1_active_minus1, num_ref_idx_l0_default_active_minus1, and num_ref_idx_l1_default_active_minus1 are all in the range 0 to 14, inclusive. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/libopenh264: refine the codeJun Zhao2023-04-221-2/+3
| | | | | | refine the code Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc/libopenh264: Support full range videos in transcodingJun Zhao2023-04-221-1/+4
| | | | | | | Support full range videos when transcoding, enabled the YUVJ420P to avoid auto scale from YUVJ420P to YUV420P Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/pcm_rechunk_bsf: assert that in_pkt is empty after merging its data ↵James Almer2023-04-211-0/+1
| | | | | | | | into out_pkt If it's not empty here, then a leak would ocurr immediately after. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mjpegdec: fix remaining RGB JPEGsLeo Izen2023-04-211-6/+3
| | | | | | | | | The change introduced in b18a9c29713abc3a1b081de3f320ab53a47120c6 created a regression for non-subsampled progressive RGB jpegs. This should fix that. Additionally, this should fix other RGB JPEGs broken before the recent patches, such as those in Trac issue #10190.
* avcodec/pdvdec: honor the requested avctx->skip_frame valueJames Almer2023-04-201-0/+5
| | | | | | | | The decoder is tagged as being FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, so might as well make use of it. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>