mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-17 13:04:50 +00:00
Fix segfault in save_bits:
use put_bits_count to get the buffer fill state instead of num_saved_bits as num_saved_bits is sometimes reset when frames are lost (Ticket 495)
This commit is contained in:
parent
43e05685f2
commit
780d45473c
@ -1436,7 +1436,7 @@ static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
|
||||
init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
|
||||
}
|
||||
|
||||
buflen = (s->num_saved_bits + len + 8) >> 3;
|
||||
buflen = (put_bits_count(&s->pb) + len + 8) >> 3;
|
||||
|
||||
if (len <= 0 || buflen > MAX_FRAMESIZE) {
|
||||
av_log_ask_for_sample(s->avctx, "input buffer too small\n");
|
||||
|
Loading…
Reference in New Issue
Block a user