jvdec: unbreak video decoding
authorPaul B Mahol <onemda@gmail.com>
Wed, 14 Mar 2012 03:02:02 +0000 (03:02 +0000)
committerJanne Grunau <janne-libav@jannau.net>
Wed, 14 Mar 2012 14:34:50 +0000 (15:34 +0100)
The safe bitstream reader broke it since the buffer size was specified
in bytes instead of bits.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
CC: libav-stable@libav.org
libavcodec/jvdec.c

index 5d4fdea..ffa2f5a 100644 (file)
@@ -150,7 +150,7 @@ static int decode_frame(AVCodecContext *avctx,
 
         if (video_type == 0 || video_type == 1) {
             GetBitContext gb;
-            init_get_bits(&gb, buf, FFMIN(video_size, (buf_end - buf) * 8));
+            init_get_bits(&gb, buf, 8 * FFMIN(video_size, buf_end - buf));
 
             for (j = 0; j < avctx->height; j += 8)
                 for (i = 0; i < avctx->width; i += 8)