nuv: Reset the frame on resize
authorLuca Barbato <lu_zero@gentoo.org>
Tue, 13 Aug 2013 04:01:48 +0000 (06:01 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 16 Oct 2013 21:05:51 +0000 (23:05 +0200)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavcodec/nuv.c

libavcodec/nuv.c

index 8545d863d9ae5e678ef7f090783aabd916298c74..ea5e9ee0428deda0759ae7df0e9162b2bf28819d 100644 (file)
@@ -129,6 +129,8 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, int qualit
         } else
             c->decomp_buf = ptr;
         rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
+        if (c->pic.data[0])
+            avctx->release_buffer(avctx, &c->pic);
     } else if (quality != c->quality)
         rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
     return 0;