diff options
author | Jai Menon <jmenon86@gmail.com> | 2009-12-01 11:38:37 +0000 |
---|---|---|
committer | Jai Menon <jmenon86@gmail.com> | 2009-12-01 11:38:37 +0000 |
commit | de3553b078e730f110a6f922dca8eeace38b8330 (patch) | |
tree | 53f19a226d068af98b4ebdfa2d4a501803f5244c /libavcodec | |
parent | 483aad717e898c265fde51e1a837e51bedff6faa (diff) | |
download | ffmpeg-de3553b078e730f110a6f922dca8eeace38b8330.tar.gz |
pngdec.c : release allocated buffers.
Originally committed as revision 20680 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pngdec.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 29644f5095..6cce626fd3 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -642,6 +642,18 @@ static av_cold int png_dec_init(AVCodecContext *avctx){ 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 @@ AVCodec png_decoder = { sizeof(PNGDecContext), png_dec_init, NULL, - NULL, //decode_end, + png_dec_end, decode_frame, CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/, NULL, |