avcodec/ivi: Check luma/chroma mb_size
authorMichael Niedermayer <[email protected]>
Tue, 15 Jul 2025 21:28:09 +0000 (23:28 +0200)
committerMichael Niedermayer <[email protected]>
Mon, 4 Aug 2025 16:51:39 +0000 (18:51 +0200)
Fixes: shift exponent -1 is negative
Fixes: 429011224/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5031059358285824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit c0f1c3e18579c249cc729bc6033c034f6a6f7426)
Signed-off-by: Michael Niedermayer <[email protected]>
libavcodec/ivi.c

index 60769664a1296d8c9fc4afe472ed7271d260e988..842666ac5a9d3d2cca4c6c7cd6b8a25c7693b748 100644 (file)
@@ -993,9 +993,11 @@ static int decode_band(IVI45DecContext *ctx,
     for (t = 0; t < band->num_tiles; t++) {
         tile = &band->tiles[t];
 
-        if (tile->mb_size != band->mb_size) {
-            av_log(avctx, AV_LOG_ERROR, "MB sizes mismatch: %d vs. %d\n",
-                   band->mb_size, tile->mb_size);
+        if (tile->mb_size != band->mb_size ||
+            ctx->planes[0].bands[0].mb_size < band->mb_size
+        ) {
+            av_log(avctx, AV_LOG_ERROR, "MB sizes mismatch: %d vs. %d vs. %d\n",
+                   band->mb_size, tile->mb_size, ctx->planes[0].bands[0].mb_size);
             return AVERROR_INVALIDDATA;
         }
         tile->is_empty = get_bits1(&ctx->gb);