[FFmpeg-cvslog] kgv1: release reference picture on size change.

Ronald S. Bultje git at videolan.org
Mon Apr 2 01:45:11 CEST 2012


ffmpeg | branch: release/0.8 | Ronald S. Bultje <rsbultje at gmail.com> | Fri Feb 24 16:27:53 2012 -0800| [25784c040904d3b5bc532583495b0a473360e246] | committer: Reinhard Tartler

kgv1: release reference picture on size change.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit 6c4c27adb61b2881a94ce5c7d97ee1c8adadb5fe)

Signed-off-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25784c040904d3b5bc532583495b0a473360e246
---

 libavcodec/kgv1dec.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c
index 88c54bf..e26fd81 100644
--- a/libavcodec/kgv1dec.c
+++ b/libavcodec/kgv1dec.c
@@ -54,8 +54,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;
 



More information about the ffmpeg-cvslog mailing list