avcodec/ac3dec: use init_get_bits8()
authorPaul B Mahol <onemda@gmail.com>
Tue, 3 Feb 2015 15:15:11 +0000 (15:15 +0000)
committerPaul B Mahol <onemda@gmail.com>
Wed, 4 Feb 2015 09:45:41 +0000 (09:45 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/ac3dec.c

index d3e8713..20c2889 100644 (file)
@@ -1429,7 +1429,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
         memcpy(s->input_buffer, buf, FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE));
     buf = s->input_buffer;
     /* initialize the GetBitContext with the start of valid AC-3 Frame */
-    init_get_bits(&s->gbc, buf, buf_size * 8);
+    if ((ret = init_get_bits8(&s->gbc, buf, buf_size)) < 0)
+        return ret;
 
     /* parse the syncinfo */
     err = parse_frame_header(s);