vima: check packet size before initializing bitstream reader

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2012-09-30 15:14:28 +00:00
parent 06f5edc9be
commit 857797bc14

View File

@ -141,11 +141,11 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int8_t channel_hint[2];
int ret, chan, channels = 1;
init_get_bits(&gb, pkt->data, pkt->size * 8);
if (pkt->size < 13)
return AVERROR_INVALIDDATA;
init_get_bits(&gb, pkt->data, pkt->size * 8);
samples = get_bits_long(&gb, 32);
if (samples == 0xffffffff) {
skip_bits_long(&gb, 32);