diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-02-15 16:21:34 -0800 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-03-13 23:36:02 +0100 |
commit | d4f2786cda271ed408e59f68e4a656f610a39808 (patch) | |
tree | 9b38fa26b2f6e9fb91946349eb489c9746334376 | |
parent | 2744fdbd9e1ee6a10f7627147be6556d04c1a88a (diff) | |
download | ffmpeg-d4f2786cda271ed408e59f68e4a656f610a39808.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
(cherry picked from commit 83f15a1228895434a982c840b09edccd1c64e800)
Conflicts:
libavcodec/cavsdec.c
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/cavsdec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 2f4b6e3b14..b0e517bbc5 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -655,7 +655,8 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, if (buf_size == 0) { if (!s->low_delay && h->DPB[0].f.data[0]) { *data_size = sizeof(AVPicture); - *picture = *(AVFrame *) &h->DPB[0]; + *picture = h->DPB[0].f; + memset(&h->DPB[0], 0, sizeof(h->DPB[0])); } return 0; } |