summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* avcodec/webp: Check more directly for invalid codesAndreas Rheinhardt2025-04-251-2/+5
| | | | | | | | | | Don't rely on invalid codes leading to get_vlc2() returning -1, which then gets converted to an uint8_t, i.e. to 255 and runs afoul of a length check later. After all, get_vlc2() could be changed to return something else which may be valid when cast to uint8_t. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/cbs: Use put_bits63()Andreas Rheinhardt2025-04-251-8/+2
| | | | | | | | | | It is better when BUF_BITS == 64 (i.e. on x64), because the underlying put_bits can then handle 0..63 bits naturally. It does not worsen the code when BUF_BITS != 64, because the compiler can optimize this to the same code as now (due to the assert). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp6: Forward error codesAndreas Rheinhardt2025-04-251-14/+19
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp6: Use fewer number of bits in run VLCsAndreas Rheinhardt2025-04-252-7/+12
| | | | | | | | | Given that these trees have only nine elements and are complete, their depth is <= eight. Also remove the now unused FF_HUFFMAN_BITS constant. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp6: Don't reload unnecessarily often in get_vlc2()Andreas Rheinhardt2025-04-251-3/+3
| | | | | | | | | | | The VLC trees used here have very few different codes and are therefore guaranteed to not be very deep: The AC/DC VLCs have 12 elements and therefore a depth <= 11 whereas the run VLCs have only nine elements and therefore a depth <= 8. This allows to reduce the worst-case number of reloads for reading a VLC code. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp6: Don't initialize unused VLC tablesAndreas Rheinhardt2025-04-252-7/+5
| | | | | | | There are only 2*3*4 VLC trees for decoding Huffman encoded AC coefficients; see section 13.3.2 of the spec. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/huffman: Switch to ff_vlc_init_from_lengths()Andreas Rheinhardt2025-04-251-14/+10
| | | | | | Avoids having to create the codes ourselves. Signed-off-by: Andreas Rheinhardt <[email protected]>
* tools/target_dec_fuzzer: Assert on AVERROR_BUGAndreas Rheinhardt2025-04-251-2/+8
| | | | | | | This will bring these bugs to our attention. Reviewed-by: Kacper Michajlow <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ftr: Replace AVERROR_BUG that can be triggeredAndreas Rheinhardt2025-04-251-1/+1
| | | | | | | | | | Return AVERROR_DECODER_NOT_FOUND. (This can be triggered because this decoder tries to be generic and work with multiple underlying AAC decoders, so that there is no configure dependency for any decoder.) Reviewed-by: Kacper Michajlow <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/imm5: Reference H.264/HEVC decoders directlyAndreas Rheinhardt2025-04-251-11/+7
| | | | | | | | | | | | This is simpler and allows to fuzz them -- up until now, the linker did not see the dependency and fuzzing them returned AVERROR_BUG during init. It took just a few seconds here to run into an assert due to a return value of AVERROR(EAGAIN) in the decode callback... Reviewed-by: Kacper Michajlow <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* tools/target_dec_fuzzer: Remove mjpeg hackAndreas Rheinhardt2025-04-251-5/+0
| | | | | | | | | | | | | | ff_mjpeg_decoder is now referenced directly by the relevant decoders, so that the linker sees the dependency and just does the desired thing. So remove the hack. (Btw: The preprocessor does not do string comparisons, instead undefined tokens in #if checks evaluate to 0, making the check true regardless of the actual codec fuzzed (and leading to linker errors if the mjpeg decoder is disabled).) Reviewed-by: Kacper Michajlow <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/cri,tdsc,tiff: Use ff_mjpeg_decoder directlyAndreas Rheinhardt2025-04-253-18/+12
| | | | | | | | | | | | This is simpler than calling avcodec_find_decoder(). Notice that av_codec_init_static() has already been called by the time we reach these decoders' init functions, so it is not necessary to call avcodec_find_decoder() for it (which doesn't do anything for the mjpeg decoder anyway). Reviewed-by: Kacper Michajlow <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/h264_slice: insert LCEVC side data before get_buffer() callJames Almer2025-04-231-0/+7
| | | | | | Otherwise it will not be taken into account or applied at all. Signed-off-by: James Almer <[email protected]>
* vulkan: use _KHR suffix for push descriptor properties struct IDLynne2025-04-231-1/+1
|
* rtpdec_mpeg4: Add fmtp parsing of bitrate valueErik Linge2025-04-221-0/+7
| | | | | | | According to RFC 6416 the audio stream sender can pass the data rate for the audio bitstream as "bitrate=" media format parameter. Signed-off-by: Marvin Scholz <[email protected]>
* ffbuild: fix include path for uninstalled .pc filesMarvin Scholz2025-04-221-1/+1
|
* avfilter/drawutils: narrow variable scopesMarvin Scholz2025-04-221-46/+39
|
* tools/aviocat: use av_err2strMarvin Scholz2025-04-221-9/+4
| | | | | There is no need to explicitly specify the buffer, as it is only ever passed to fprintf, so av_err2str can be used.
* tools/sidxindex: use av_err2strMarvin Scholz2025-04-221-5/+3
| | | | | There is no need to explicitly specify the buffer, as it is only ever passed to fprintf, so av_err2str can be used.
* tools/ismindex: use av_err2strMarvin Scholz2025-04-221-8/+4
| | | | | There is no need to explicitly specify the buffer, as it is only ever passed to fprintf, so av_err2str can be used.
* tests: lavfi/drawutils: use av_err2strMarvin Scholz2025-04-221-3/+1
| | | | | There is no need to explicitly specify the buffer, as it is only ever passed to printf, so av_err2str can be used.
* lavfi/vf_xpsnr: use av_err2strMarvin Scholz2025-04-221-3/+2
| | | | | There is no need to explicitly specify the buffer, as it is only ever passed to av_log, so av_err2str can be used.
* avformat/crypto: use av_err2strMarvin Scholz2025-04-221-3/+1
| | | | | There is no need to explicitly specify the buffer, as it is only ever passed to av_log, so av_err2str can be used.
* avformat/dashdec: use av_err2strMarvin Scholz2025-04-221-6/+3
| | | | | There is no need to explicitly specify the buffer, as it is only ever passed to av_log, so av_err2str can be used.
* hwcontext_vulkan: enable subgroupSizeControlLynne2025-04-221-0/+1
| | | | | | | We already use this feature for setting the subgroup size, but this feature was not enabled. Fixes a validation warning.
* vulkan: move OPT_CHAIN out of hwcontext_vulkanLynne2025-04-223-84/+64
| | | | | | This allows for it to be shared. Technically, implementations should not give drivers structs that the drivers are not familiar with.
* vulkan: check that the max number of push descriptors is not exceededLynne2025-04-222-5/+11
| | | | | | Just correctness. We don't exceed this on any known hardware, but its better to check. If we do, we simply fall back to regular descriptors.
* vulkan: move feature<->usage mapping code outside of hwcontext_vulkan.cLynne2025-04-223-36/+46
| | | | | Allows for it to be reused. In particular, for a future patch to make vulkan hwaccels output DMABUF-backed VkImages.
* avformat/takdec.c: return proper error codes for avio_read() failuresJames Almer2025-04-211-4/+6
| | | | | Suggested-by: Nicolas George <[email protected]> Signed-off-by: James Almer <[email protected]>
* libavformat/takdec.c: Fix msan errorThierry Foucu2025-04-211-1/+2
| | | | | | Make sure we are reading 16 bytes for the MD5 Signed-off-by: James Almer <[email protected]>
* avcodec/vc2enc: Improve error codesAndreas Rheinhardt2025-04-211-3/+3
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp8: Maintain consistency of frame pointersAndreas Rheinhardt2025-04-211-4/+7
| | | | | | | | | | | | | | | | | | | | | Right now it is possible for the pointer for the current frame to be set in the context even when it could not be properly set up; this does not influence the ordinary ref frames, but only VP8Context.prev_frame. And since this code has been ported to the ProgressFrame API in d48d7bc434f30dfbdf346f16715e4f2044b3e000, this leads to segfaults, because the ProgressFrame API is less forgiving than the ThreadFrame API (waiting on an uninitialized ProgressFrame segfaults, waiting on an uninitialized ThreadFrame is a no-op (the code behaves as if frame-threading is not in use)). Fix this by maintaining the consistency of the frame pointers in the context (by setting them later). Fixes: NULL pointer dereference Fixes: 68192/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP8_fuzzer-6180311026171904 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Andreas Rheinhardt <[email protected]>
* avutil/hwcontext: Add item_name function for AVHWDeviceContextsoftworkz2025-04-211-1/+7
| | | | Signed-off-by: softworkz <[email protected]>
* avutil/log,hwcontext: Add AV_CLASS_CATEGORY_HWDEVICEsoftworkz2025-04-215-1/+7
| | | | Signed-off-by: softworkz <[email protected]>
* avcodec/dvbsubenc: Check nb_colors before using itAndreas Rheinhardt2025-04-201-6/+5
| | | | | | | Avoids a potential overflow when multiplying nb_colors by 6. Also make the nb_colors check a bit more strict. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/dvbsubenc: Sanity check num_rectsAndreas Rheinhardt2025-04-201-0/+3
| | | | | | | | It is written as region_id which is a single byte. Also fixes a potential (defined) overflow in the num_rects * 6 multiplication later; this has been found by 김승호 <[email protected]>. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Hoist check out of loopAndreas Rheinhardt2025-04-201-4/+6
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Avoid excessive logmessagesAndreas Rheinhardt2025-04-201-7/+2
| | | | | | AVERROR(ENOMEM) is enough. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Switch to unchecked bytestream2 APIAndreas Rheinhardt2025-04-201-37/+37
| | | | | | | We have already calculated the size of the packet and therefore don't need to rely on these implicit checks. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Calculate proper packet size in advanceAndreas Rheinhardt2025-04-201-50/+44
| | | | | | | | | This can be easily done because we have a count of the number of values and the length of the associated codes. This allows to switch to ff_get_encode_buffer() and thereby avoids an implicit intermediate buffer. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Avoid PutBitContext for byte-aligned writesAndreas Rheinhardt2025-04-201-11/+5
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Simplify padding sliceAndreas Rheinhardt2025-04-201-10/+6
| | | | | | | Do it before writing the actual slice to be able to use a single AV_WN32(). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Avoid intermediate bufferAndreas Rheinhardt2025-04-201-30/+14
| | | | | | | | Given that we can calculate the size of each slice in advance, we can determine the position in the output packet where it needs to be put and can therefore avoid the intermediate buffer. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Check in advance whether to encode a slice rawAndreas Rheinhardt2025-04-201-10/+24
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Store slice width and heightAndreas Rheinhardt2025-04-201-12/+9
| | | | | | Avoids rederiving it every time. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Only keep in Slice what is usedAndreas Rheinhardt2025-04-201-6/+6
| | | | | | Namely the number of counts. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Fix Huffman element probabilitiesAndreas Rheinhardt2025-04-203-11/+11
| | | | | | | | The earlier code only used the counts from the last slice. The two FATE tests using slices show compression improvements due to this. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Restrict number of slice-planes to 256Andreas Rheinhardt2025-04-201-0/+1
| | | | | | | | Every frame contains an array of uint8_t with values 0..(s->planes * s->nb_slices - 1), so this needs to fit into an uint8_t. Signed-off-by: Andreas Rheinhardt <[email protected]>
* fate/vcodec: Add MagicYUV testsAndreas Rheinhardt2025-04-205-0/+25
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/magicyuvenc: Fix setting nb_slicesAndreas Rheinhardt2025-04-201-1/+1
| | | | | | | | | Do not derive it via av_cpu_count() in case AVCodecContext.slices is unset. Instead default to AVCodecContext.thread_num instead (which is one in case frame-threading is used and gives the actual number of slice threads for slice threading). Signed-off-by: Andreas Rheinhardt <[email protected]>