[FFmpeg-cvslog] avcodec/ivi: Check luma/chroma mb_size

Michael Niedermayer git at videolan.org
Mon Aug 4 23:57:20 EEST 2025


ffmpeg | branch: release/7.0 | Michael Niedermayer <michael at niedermayer.cc> | Tue Jul 15 23:28:09 2025 +0200| [17e0e7e7085eb2c200614d7905abf9f41217e3db] | committer: Michael Niedermayer

avcodec/ivi: Check luma/chroma mb_size

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 <michael at niedermayer.cc>
(cherry picked from commit c0f1c3e18579c249cc729bc6033c034f6a6f7426)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=17e0e7e7085eb2c200614d7905abf9f41217e3db
---

 libavcodec/ivi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c
index 60769664a1..842666ac5a 100644
--- a/libavcodec/ivi.c
+++ b/libavcodec/ivi.c
@@ -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);



More information about the ffmpeg-cvslog mailing list