cljr: fix buf_size sanity check
authorPaul B. Mahol <onemda@gmail.com>
Sat, 17 Dec 2011 17:58:06 +0000 (17:58 +0000)
committerJanne Grunau <janne-libav@jannau.net>
Sun, 18 Dec 2011 22:52:53 +0000 (23:52 +0100)
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
libavcodec/cljr.c

index f40d4d1..cf307bb 100644 (file)
@@ -62,7 +62,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;