Fixes assertion failure
Fixes: 0256e92df2df7e933b43a2c70e4c8040/signal_sigabrt_7ffff6ae7cc9_1358_999ac18684788221490757582ce9af84.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7ad698e24e6b9dde57c4e01c145bcddfe9d6e4a3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
... | ... |
@@ -1623,6 +1623,11 @@ static int decode_packet(AVCodecContext *avctx, void *data, |
1623 | 1623 |
s->packet_done = 1; |
1624 | 1624 |
} |
1625 | 1625 |
|
1626 |
+ if (remaining_bits(s, gb) < 0) { |
|
1627 |
+ av_log(avctx, AV_LOG_ERROR, "Overread %d\n", -remaining_bits(s, gb)); |
|
1628 |
+ s->packet_loss = 1; |
|
1629 |
+ } |
|
1630 |
+ |
|
1626 | 1631 |
if (s->packet_done && !s->packet_loss && |
1627 | 1632 |
remaining_bits(s, gb) > 0) { |
1628 | 1633 |
/** save the rest of the data so that it can be decoded |