Commit 9f5b75f2 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/flacdec: make while get_bits loop more robust by checking bits left

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0c6bb53b
......@@ -366,8 +366,11 @@ static inline int decode_subframe(FLACContext *s, int channel)
bps, left);
return AVERROR_INVALIDDATA;
}
while (!get_bits1(&s->gb))
while (!get_bits1(&s->gb)) {
wasted++;
if (get_bits_left(&s->gb) <= 0)
return AVERROR_INVALIDDATA;
}
bps -= wasted;
}
if (bps > 32) {
......
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