Browse Source

kgv1: release reference picture on size change.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
tags/n0.8.11
Ronald S. Bultje Reinhard Tartler 14 years ago
parent
commit
25784c0409
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/kgv1dec.c

+ 4
- 1
libavcodec/kgv1dec.c View File

@@ -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)) if (av_image_check_size(w, h, 0, avctx))
return -1; 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); avcodec_set_dimensions(avctx, w, h);
}


maxcnt = w * h; maxcnt = w * h;




Loading…
Cancel
Save