Commit 17a31b25af for ffmpeg
commit 17a31b25af58f4a97e2a52f1e682bf2cb59e0fb7
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Mon Nov 16 16:23:44 2026 +0100
avcodec/cbs_apv: reject tiles smaller than their header
Assertion failure Replicated through UnModified FFmpeg
Found during triage of the OSS-Fuzz issue 575066671
Fixes: Assertion tile_size >= current->tile_header.tile_header_size + data_size failed
Fixes: JG7KeTpWk1S2/apv-tilesize10.apv
Fixes: JG7KeTpWk1S2
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 69d38dd851..c9cb61aea5 100644
--- a/libavcodec/cbs_apv_syntax_template.c
+++ b/libavcodec/cbs_apv_syntax_template.c
@@ -207,6 +207,8 @@ static int FUNC(tile_header)(CodedBitstreamContext *ctx, RWContext *rw,
u(16, tile_index, tile_idx, tile_idx);
+ if (tile_size < current->tile_header_size)
+ return AVERROR_INVALIDDATA;
tile_size_remaining = tile_size - current->tile_header_size;
for (int c = 0; c < priv->num_comp; c++) {
us(32, tile_data_size[c], 1, tile_size_remaining, 1, c);