1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

wmalosslessdec: Reset put bit buffer when num_saved_bits is reset.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-04-14 16:32:56 +02:00
parent b3a4351582
commit 64bd7f8e4d

View File

@ -1224,6 +1224,7 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
/* Reset number of saved bits so that the decoder does not start
* to decode incomplete frames in the s->len_prefix == 0 case. */
s->num_saved_bits = 0;
init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
s->packet_loss = 0;
}
@ -1273,6 +1274,7 @@ static void flush(AVCodecContext *avctx)
s->packet_loss = 1;
s->packet_done = 0;
s->num_saved_bits = 0;
init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
s->frame_offset = 0;
s->next_packet_start = 0;
s->cdlms[0][0].order = 0;