Commit 64bd7f8e authored by Michael Niedermayer's avatar Michael Niedermayer

wmalosslessdec: Reset put bit buffer when num_saved_bits is reset.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b3a43515
......@@ -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;
......
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