avcodec/flacdec: make while get_bits loop more robust by checking bits left
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0c6bb53bb2
commit
9f5b75f241
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user