aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
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 01:19:21 +0200
commitc9c6e5f4e8680b7b7801dd6943590ae9cd6bfd89 (patch)
treedcce97f2dcf4cb4f4215b38517cebd3547a3fb13 /libavcodec
parenta5a02ea3f2bb4e89d9ee0e381c938bd83e5c369d (diff)
downloadffmpeg-c9c6e5f4e8680b7b7801dd6943590ae9cd6bfd89.tar.gz
Release old pictures after a resolution change in vp5/6 decoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit dba20b84784a7931b7eac50ced1d43e86801bde9)
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp56.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index cf891763f6..25ec7a376d 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -513,6 +513,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) {