aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-15 16:21:34 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2012-03-07 16:33:35 -0800
commit83f15a1228895434a982c840b09edccd1c64e800 (patch)
tree9ab93ba4105d99cc3496ef9080f4e2dc0d9b7154
parentfd0be63049ed46660993d0550a4f0847a0b942ea (diff)
downloadffmpeg-83f15a1228895434a982c840b09edccd1c64e800.tar.gz
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
-rw-r--r--libavcodec/cavsdec.c1
1 files changed, 1 insertions, 0 deletions
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;
}