Commit graph

14 commits

Author SHA1 Message Date
Andreas Rheinhardt
1df63acdc4 avcodec: Add av_cold to flush,init,close functions missing it
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-13 20:37:03 +00:00
James Almer
3ef2ea890b avcodec/apv_decode: set decoder as skip frame fill param capable
No need to decode potentially huge frames just to get stream params.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-12 19:59:21 +00:00
James Almer
084b67f6e3 avcodec/apv: port to the receive_frame() API
You can technically feed the decoder a single packet with more than one AU in
it, even if a demuxer is unlikely to ever export such a thing.
Given the parser does no packetization to ensure we get a single AU, in order
to not discard any frame beyond the first, the decoupled input/output API
should be used.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-12 19:59:21 +00:00
James Almer
4b39d776c3 avcodec/cbs_apv: store derived tile information in a per frame basis
If a single fragment contains more than one frame unit, the tile information stored
in the private context will only correspond to one of them.

Fixes: crash (out of array access)
Fixes: 435489659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-6194885205229568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-12 19:59:21 +00:00
Michael Niedermayer
cfce595572 avcodec/apv_decode: make apv_format_table consistent with the code and check it
Fixes: writing in a null pointer
Fixes: 435278398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-4566392923029504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-10 02:29:09 +00:00
Mark Thompson
a3c8fba5da apv_decode: Multisymbol entropy decode 2025-05-13 19:37:49 +01:00
Mark Thompson
2aa2095bb4 cbs_apv: Better constrain tile_width/height_in_mbs
The maximum number of tile columns/rows adds an extra constraint on
the minimum tile width/height for large frames (over 5120 width or
2560 height).
2025-05-05 17:22:57 +01:00
Mark Thompson
1a9a2bafc8 apv_decode: Improve reporting of decode errors
Halt tile component decoding at the first entropy error (this will be a
desync and is not recoverable).  If any tile components contain errors
then discard the frame unless the output-corrupt flag is set.

Also fixes CID 1646764, which is the error case where the tile component
is too large for get_bits to handle.
2025-05-05 17:22:57 +01:00
Mark Thompson
5acd2145a4 apv_decode: Fix memory leak on decode error 2025-05-05 17:22:57 +01:00
James Almer
a9557c1f26 avcodec/apv_decode: build the lut table only once
No reason to build the exact same table once per decoding thread.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-05 13:19:29 -03:00
Mark Thompson
585455f7b3 apv_decode: Replace division with shift
The compiler can't see that this should be a shift and generates a real
division which is slow enough to appear in profiles on its own.
2025-04-30 22:57:56 +01:00
Andreas Rheinhardt
fcc562693e avcodec/apv_decode: Remove redundant log message
ff_thread_get_buffer() already emits its own logmessage.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-27 23:00:10 +02:00
Andreas Rheinhardt
e2fcf234e4 avcodec/apv_decode: Fix shadowing
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-27 23:00:07 +02:00
Mark Thompson
483cadf8d7 lavc: APV decoder 2025-04-27 15:52:30 +01:00