summaryrefslogtreecommitdiff
path: root/libavcodec/vp56.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-21 20:46:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-22 00:42:28 +0200
commitdba20b84784a7931b7eac50ced1d43e86801bde9 (patch)
treedbf7eec24149c425284eabdce7089433d5c1503b /libavcodec/vp56.c
parent6a0e78929aa7d6b2c6b598c1589fb0e48fccb132 (diff)
Release old pictures after a resolution change in vp5/6 decoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vp56.c')
-rw-r--r--libavcodec/vp56.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index f3ffa44a51..c3cfbe29f4 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -515,6 +515,16 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if (!res)
return -1;
+ if (res == 2) {
+ int i;
+ for (i = 0; i < 4; i++) {
+ if (s->frames[i].data[0])
+ avctx->release_buffer(avctx, &s->frames[i]);
+ }
+ if (is_alpha)
+ return -1;
+ }
+
if (!is_alpha) {
p->reference = 1;
if (avctx->get_buffer(avctx, p) < 0) {