rv34: check for size mismatch
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 17 Sep 2011 17:40:25 +0000 (19:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Nov 2011 17:32:40 +0000 (18:32 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 35f38b3ab9d755aede5bce8abbe1cb9c07027f8a)
(cherry picked from commit ed9e561490d70e317659f9e406c7920242e509eb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/rv34.c

index da20dbb..c4e3621 100644 (file)
@@ -1276,6 +1276,10 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
             av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
             return AVERROR_INVALIDDATA;
         }
+        if (s->width != r->si.width || s->height != r->si.height) {
+            av_log(s->avctx, AV_LOG_ERROR, "Size mismatch\n");
+            return AVERROR_INVALIDDATA;
+        }
     }
 
     r->si.end = end;