X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fac3dec.c;h=2f78d73ce897bef3bcdb2545ffe6651ff8ec387f;hb=b491751409bcbc70dc83669ad7f7667cc372528f;hp=d3e8713e0319c7ef88b4528ca6b7d94ab128e5f0;hpb=56252a5e097946be03ba67664d5efc20703a17a1;p=ffmpeg diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index d3e8713e031..2f78d73ce89 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -485,7 +485,7 @@ static void calc_transform_coeffs_cpl(AC3DecodeContext *s) /** * Grouped mantissas for 3-level 5-level and 11-level quantization */ -typedef struct { +typedef struct mant_groups { int b1_mant[2]; int b2_mant[2]; int b4_mant; @@ -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);