Commit c99d2728 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wmaprodec: check that there are input bits left in decode_subframe_length()

Fixes infinite loop
Fixes Ticket2987
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 45f0623a
......@@ -500,6 +500,9 @@ static int decode_subframe_length(WMAProDecodeCtx *s, int offset)
if (offset == s->samples_per_frame - s->min_samples_per_subframe)
return s->min_samples_per_subframe;
if (get_bits_left(&s->gb) < 1)
return AVERROR_INVALIDDATA;
/** 1 bit indicates if the subframe is of maximum length */
if (s->max_subframe_len_bit) {
if (get_bits1(&s->gb))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment