[FFmpeg-cvslog] indeo4: check that num_mbs matches

Michael Niedermayer git at videolan.org
Thu May 3 01:44:30 CEST 2012


ffmpeg | branch: release/0.9 | Michael Niedermayer <michaelni at gmx.at> | Sat Mar 31 21:42:50 2012 +0200| [5d6982c13bba56115125de68969f46906038b73e] | committer: Michael Niedermayer

indeo4: check that num_mbs matches

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d3db8988d5befd8702a748cf1957415677bfe75c)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/indeo4.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 9ce701b..6763af4 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -473,6 +473,11 @@ static int decode_mb_info(IVI4DecContext *ctx, IVIBandDesc *band,
     mv_scale = (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3);
     mv_x = mv_y = 0;
 
+    if (((tile->width + band->mb_size-1)/band->mb_size) * ((tile->height + band->mb_size-1)/band->mb_size) != tile->num_MBs) {
+        av_log(avctx, AV_LOG_ERROR, "num_MBs mismatch %d %d %d %d\n", tile->width, tile->height, band->mb_size, tile->num_MBs);
+        return -1;
+    }
+
     for (y = tile->ypos; y < tile->ypos + tile->height; y += band->mb_size) {
         mb_offset = offs;
 



More information about the ffmpeg-cvslog mailing list