# HG changeset patch # User jai_menon # Date 1259667517 0 # Node ID eb37707704e43ba6d65e4a9a16419f876fd9a513 # Parent cf7af348a11a5650d01c04a67fcf8a988fcbc8e8 pngdec.c : release allocated buffers. diff -r cf7af348a11a -r eb37707704e4 pngdec.c --- a/pngdec.c Tue Dec 01 02:07:46 2009 +0000 +++ b/pngdec.c Tue Dec 01 11:38:37 2009 +0000 @@ -642,6 +642,18 @@ return 0; } +static av_cold int png_dec_end(AVCodecContext *avctx) +{ + PNGDecContext *s = avctx->priv_data; + + if (s->picture1.data[0]) + avctx->release_buffer(avctx, &s->picture1); + if (s->picture2.data[0]) + avctx->release_buffer(avctx, &s->picture2); + + return 0; +} + AVCodec png_decoder = { "png", CODEC_TYPE_VIDEO, @@ -649,7 +661,7 @@ sizeof(PNGDecContext), png_dec_init, NULL, - NULL, //decode_end, + png_dec_end, decode_frame, CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/, NULL,