aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-24 16:27:53 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2012-02-25 07:53:44 -0800
commit6c4c27adb61b2881a94ce5c7d97ee1c8adadb5fe (patch)
tree0b883e4d0a8448c7adc1e22b72ef9a2e22714cd1
parentcd40c31ee9ad2cca6f3635950b002fd46be07e98 (diff)
downloadffmpeg-6c4c27adb61b2881a94ce5c7d97ee1c8adadb5fe.tar.gz
kgv1: release reference picture on size change.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
-rw-r--r--libavcodec/kgv1dec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c
index ca639b7c5d..42bbcae530 100644
--- a/libavcodec/kgv1dec.c
+++ b/libavcodec/kgv1dec.c
@@ -61,8 +61,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
if (av_image_check_size(w, h, 0, avctx))
return -1;
- if (w != avctx->width || h != avctx->height)
+ if (w != avctx->width || h != avctx->height) {
+ if (c->prev.data[0])
+ avctx->release_buffer(avctx, &c->prev);
avcodec_set_dimensions(avctx, w, h);
+ }
maxcnt = w * h;