From dba20b84784a7931b7eac50ced1d43e86801bde9 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Wed, 21 Sep 2011 20:46:33 +0200 Subject: [PATCH] Release old pictures after a resolution change in vp5/6 decoder Signed-off-by: Michael Niedermayer --- libavcodec/vp56.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) {