aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-31 21:42:50 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-06 01:42:01 +0200
commit96acb0a4eb83686f0b05bf095bec6db09af85405 (patch)
treebf5bd8f502fd27152e5063a7b4328f75d33b78a2
parentdf93682e64e0e917d96c8af6519a2793c28117c5 (diff)
downloadffmpeg-96acb0a4eb83686f0b05bf095bec6db09af85405.tar.gz
indeo4: check that num_mbs matches
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit d3db8988d5befd8702a748cf1957415677bfe75c)
-rw-r--r--libavcodec/indeo4.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 3e8a3988d6..be7f088dc2 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -477,6 +477,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;