summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/vorbisdec: export skip_samples instead of dropping framesJames Almer2023-03-22
| | | | | | | | | | | | | | | pts may not be set on input packets, which could result in the entire stream being discarded. This reverts commit 8fc2dedfe6e8fcc58dd052bf3b85cd4754133b17, reintroducing the behavior it replaced but now allowing the caller to manually drop the preroll samples by looking at the skip_samples side data at the start while ignoring it on seek, by setting the skip_manual avctx flag. Fixes ticket #10251. Suggested-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit cbcc817353a019da4332ad43deb7bbc4e695d02a)
* lavc/decode: stop mangling last_pkt_props->opaqueAnton Khirnov2023-03-11
| | | | | | | | | | | | It is currently abused to store packet size, which breaks AV_CODEC_FLAG_COPY_OPAQUE. Use stream_index instead, which is unused in libavcodec and has the same type as size. Found-by: Martin Storsjö (cherry picked from commit a3bf63c26e6197a9b6e490538667368530a9dcd3) Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec/nvenc: avoid failing b_ref_mode check when unsetTimo Rothenpieler2023-03-10
|
* avcodec/aacps_tablegen: fix build error after avutil bumpZhao Zhili2023-03-02
| | | | | | | | | | Fix tickets #10225 DECLARE_ALIGNED has been moved to mem_internal.h. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> Reviewed-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit 814178f92647be2411516bbb82f48532373d2554)
* avcodec/nvenc: fix potential NULL pointer dereferenceZhao Zhili2023-02-28
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/motionpixels: Mask pixels to valid valuesMichael Niedermayer2023-02-25
| | | | | | | | | | Fixes: out of array access Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-6724203352555520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ac6eec1fc258efce219e4fccb84312a1b13a7a23) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/xpmdec: Check size before allocation to avoid truncationMichael Niedermayer2023-02-25
| | | | | | | | | | | Fixes:OOM Fixes:out of array access (no testcase) Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XPM_fuzzer-6573323838685184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 95f0f84dae4f040d91f1e60dc5438612c58e8906) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/bink: Avoid undefined out of array end pointers in binkb_decode_plane()Michael Niedermayer2023-02-25
| | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ea9deafd3b13233802c4548c4c58a707d76805a3) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/bink: Fix off by 1 error in ref endMichael Niedermayer2023-02-25
| | | | | | | | | | | | | | Fixes: out of array access Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-6657932926517248 Alterantivly to this it is possibly to allocate a bigger array Note: oss-fuzz assigned this issue to a unrelated theora bug so the bug number matches that Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 49487045dde6f69194332aac51fd4e598e19c7b6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: Ensure linesize for SVQ3Michael Niedermayer2023-02-25
| | | | | | | | | | Fixes: Assertion block_w * sizeof(uint8_t) <= ((buf_linesize) >= 0 ? (buf_linesize) : (-(buf_linesize)) Fixes: 54861/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-5352418248622080 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4eef658ca59d3d6ba46ab52a36d7faf5fe820874) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: allocate a line more for VC1 and WMV3Michael Niedermayer2023-02-25
| | | | | | | | | | | | | | Fixes: out of array read on 32bit Fixes: 54857/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5840588224462848 The chroma MC code reads over the currently allocated frame. Alternative fixes would be allocating a few bytes more at the end instead of a whole line extra or to adjust the threshold where the edge emu code is activated Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 01636a63d452c592ece35af6f72bb7affcad58f2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/videodsp_template: Adjust pointers to avoid undefined pointer thingsMichael Niedermayer2023-02-25
| | | | | | | | | | Fixes: subtraction of unsigned offset from 0xf6602770 overflowed to 0xf6638c80 Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-495074400600064 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f0150cd41c2d3c01050a6c4f3df1de511a217913) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: dont skip/read chunk twiceMichael Niedermayer2023-02-25
| | | | | | | | | | Fixes: out of array access Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PNG_fuzzer-6668158952144896.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit df1a38d5200e14a29903f1027b4548d595c7ff8a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: Check deloco index more exactlyMichael Niedermayer2023-02-25
| | | | | | | | | | | | Fixes: out of array access: Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PNG_fuzzer-6716193709096960 Alternatively it should be possible to limit this to 3 plane RGB 8 /16bit to ensure the size is what it should be Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit d5bae704068dc37191280e024eecb8d02b762b28) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavarc: Check kMichael Niedermayer2023-02-25
| | | | | | | | | | Fixes: Assertion failure Fixes: 55849/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6590105973555200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4dee46426e6d23adda048414433c2887314a4267) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffv1dec: Check that num h/v slices is supportedMichael Niedermayer2023-02-25
| | | | | | | | | | Fixes: out of array access Fixes: 55597/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-4898293416329216 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8ead0ae68eb64ad325efafd686c434727f3d666a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rka: avoid undefined doubling sum overflowMichael Niedermayer2023-02-25
| | | | | | | | | | Fixes: signed integer overflow: -2124073172 * 2 cannot be represented in type 'int' Fixes: 56099/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-4530933127839744 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a02e45a1f3cc6f07c7437c1e225dea2683f843cf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rka: avoid negative value shiftMichael Niedermayer2023-02-25
| | | | | | | | | | Fixes: left shift of negative value -81 Fixes: 56061/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-4649758062149632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a5d4e7e3f981ce90b92a9da7da26a3c2a2e061e9) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rka: check for size 1 filterMichael Niedermayer2023-02-25
| | | | | | | | | | | | Such filters will not advance and be stuck in the current implementation Fixes: Infinite loop Fixes: 56052/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-5236218750435328 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8874cfa2e174cf1a94123fc2f1a3aa4d307a270f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rka: Fix some integer anomaliesMichael Niedermayer2023-02-25
| | | | | | | | | | | Fixes: left shift of negative value -3201 Fixes: integer overflow: -76470276 * -25608 cannot be represented in type 'int' Fixes: 56052/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-5236218750435328 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit d495747a9fc5fb8dcac4b23c5bdca3c5c16dd152) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* version.h: Bump minor for 6.0 branchMichael Niedermayer2023-02-19
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/qsvenc: Flush cached frames before reset encoderWenbin Chen2023-02-16
| | | | | | | | | | | According to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#configuration-change. Before calling MFXVideoENCODE_Reset, The application needs to retrieve any cached frames in the SDK encoder. A loop is added before MFXVideoENCODE_Reset to retrieve cached frames and add them to async_fifo, so that dynamic configuration works when async_depth > 1. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
* libavcodec/qsvenc: Do not pass RGB solorspace to VPL/MSDKWenbin Chen2023-02-16
| | | | | | | When encode RGB frame, Intel driver convert RGB to YUV, so we cannot set RGB colorspace to VPL/MSDK. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
* avcodec/libx265: fix else clause when zeroing reordered_opaqueMarton Balint2023-02-16
| | | | | | | | | | | | | CC libavcodec/libx265.o libavcodec/libx265.c: In function ‘libx265_encode_frame’: libavcodec/libx265.c:781:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] else ^~~~ libavcodec/libx265.c:782:1: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ FF_DISABLE_DEPRECATION_WARNINGS ^~~ Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/rka: fix long_namePaul B Mahol2023-02-15
|
* avcodec/rka: fix channel value initializationPaul B Mahol2023-02-15
|
* avcodec/rka: fix decoding uncorrelated stereoPaul B Mahol2023-02-15
|
* avcodec/rka: fix array overflowPaul B Mahol2023-02-15
|
* avcodec/rka: fix lossy mode decodingPaul B Mahol2023-02-14
|
* avcodec/rka: add u8 sample format supportPaul B Mahol2023-02-13
|
* avcodec/rka: misc fixes and improvementsPaul B Mahol2023-02-13
|
* avutil/frame: deprecate AVFrame.coded_picture_number and display_picture_numberMarton Balint2023-02-13
| | | | | | | | Their usefulness is questionable, very few decoders set them, and their type should have been int64_t. A replacement field can be added later if a valid use case is found. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/mpegvideo_enc: do not use AVFrame.*_picture_number for encodingMarton Balint2023-02-13
| | | | | | Move these fields to MPEGPicture instead and use that. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/diracdec: do not use AVFrame.display_picture_number for decodingMarton Balint2023-02-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec: add AVCodecContext.frame_num as 64 bit variant to frame_numberMarton Balint2023-02-13
| | | | | | | | | | Frame counters can overflow relatively easily (INT_MAX number of frames is slightly more than 1 year for 60 fps content), so make sure we use 64 bit values for them. Also deprecate the old 32 bit frame_number attribute. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/roqaudioenc: unbreak mono encodingPaul B Mahol2023-02-11
|
* avcodec: add RKA decoderPaul B Mahol2023-02-11
|
* avcodec/tta: fix regression with new channel layout switchPaul B Mahol2023-02-11
|
* Bump major versions of all librariesJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/version: postpone the remaining API deprecationsJames Almer2023-02-09
| | | | | | They are either too recent, or still need work like FF_API_INIT_PACKET. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/{color_utils, csp}: merge color_utils into csp and expose APILeo Izen2023-02-09
| | | | | | | | | | | | | | | | | | | | | | | | libavutil/color_utils contains some avpriv_ symbols that map enum AVTransferCharacteristic values to gamma-curve approximations and to the actual transfer functions to invert them (i.e. -> linear). There's two issues with this: (1) avpriv is evil and should be avoided whenever possible (2) libavutil/csp.h exposes a public API for handling color that already handles primaries and matricies I don't see any reason this API has to be private, so this commit takes the functionality from avutil/color_utils and merges it into avutil/csp with an exposed av_ API rather than the previous avpriv_ API. Every reference to the previous API has been updated to point to the new one. color_utils.h has been deleted as well. This should not break any applications as it only contained avpriv_ symbols in the first place, so nothing in that header could be referenced by other applications. Signed-off-by: Leo Izen <leo.izen@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avutil: remove FF_API_DECLARE_ALIGNEDJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: remove FF_API_SUB_TEXT_FORMATJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: remove FF_API_FLAG_TRUNCATEDJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: remove FF_API_AVCTX_TIMEBASEJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: remove FF_API_AUTO_THREADSJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: remove FF_API_GET_FRAME_CLASSJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: remove FF_API_DEBUG_MVJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: remove FF_API_THREAD_SAFE_CALLBACKSJames Almer2023-02-09
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec: remove FF_API_UNUSED_CODEC_CAPSJames Almer2023-02-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>