From 83f15a1228895434a982c840b09edccd1c64e800 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 15 Feb 2012 16:21:34 -0800 Subject: avs: fix infinite loop on end-of-stream. The codec would keep returning the last decoded frame if the stream contains B-frames, since it wouldn't clear that frame from the list of frames to be returned to the user. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org --- libavcodec/cavsdec.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libavcodec/cavsdec.c') diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 1da4eb1922..e3201343be 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -656,6 +656,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, if (!s->low_delay && h->DPB[0].f.data[0]) { *data_size = sizeof(AVPicture); *picture = h->DPB[0].f; + memset(&h->DPB[0], 0, sizeof(h->DPB[0])); } return 0; } -- cgit v1.2.3