Commit 0fd43151bc for ffmpeg
commit 0fd43151bcdfd40d810c4c34cac69dfa292eda42
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Mon Nov 16 16:23:28 2026 +0100
avcodec/cbs_apv: check that the tile dummy bytes are within the input
Out of array read Replicated through API with ASAN
Fixes: out of array read
Fixes: 575066671/clusterfuzz-testcase-minimized-ffmpeg_BSF_APV_METADATA_fuzzer-4670056634843136
Fixes: xfPGyAEH1llq
Regression since: b5d8c529339aafc9768a025b6e363f64a7fa3154
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
diff --git a/libavcodec/cbs_apv_syntax_template.c b/libavcodec/cbs_apv_syntax_template.c
index bcc72a015d..69d38dd851 100644
--- a/libavcodec/cbs_apv_syntax_template.c
+++ b/libavcodec/cbs_apv_syntax_template.c
@@ -259,6 +259,8 @@ static int FUNC(tile)(CodedBitstreamContext *ctx, RWContext *rw,
if (padding_size > 0) {
#ifdef READ
+ if (get_bits_left(rw) < 8LL * padding_size)
+ return AVERROR_INVALIDDATA;
current->tile_dummy_byte = (uint8_t*)align_get_bits(rw);
current->tile_dummy_byte_size = padding_size;
skip_bits_long(rw, 8 * padding_size);