cljr: fix buf_size sanity check
authorPaul B. Mahol <onemda@gmail.com>
Sat, 17 Dec 2011 17:58:06 +0000 (17:58 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jan 2012 18:49:55 +0000 (19:49 +0100)
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 2e7905eee8d0f8813e703cacdd7b3ffdc4960656)

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

index 4027cff..f86d850 100644 (file)
@@ -66,7 +66,7 @@ static int decode_frame(AVCodecContext *avctx,
         return AVERROR_INVALIDDATA;
     }
 
-    if (buf_size / avctx->height < avctx->width) {
+    if (buf_size < avctx->height * avctx->width) {
         av_log(avctx, AV_LOG_ERROR,
                "Resolution larger than buffer size. Invalid header?\n");
         return AVERROR_INVALIDDATA;