Mercurial > libavcodec.hg
comparison pngdec.c @ 10611:eb37707704e4 libavcodec
pngdec.c : release allocated buffers.
author | jai_menon |
---|---|
date | Tue, 01 Dec 2009 11:38:37 +0000 |
parents | c78fd9154378 |
children | 8a4984c5cacc |
comparison
equal
deleted
inserted
replaced
10610:cf7af348a11a | 10611:eb37707704e4 |
---|---|
640 dsputil_init(&s->dsp, avctx); | 640 dsputil_init(&s->dsp, avctx); |
641 | 641 |
642 return 0; | 642 return 0; |
643 } | 643 } |
644 | 644 |
645 static av_cold int png_dec_end(AVCodecContext *avctx) | |
646 { | |
647 PNGDecContext *s = avctx->priv_data; | |
648 | |
649 if (s->picture1.data[0]) | |
650 avctx->release_buffer(avctx, &s->picture1); | |
651 if (s->picture2.data[0]) | |
652 avctx->release_buffer(avctx, &s->picture2); | |
653 | |
654 return 0; | |
655 } | |
656 | |
645 AVCodec png_decoder = { | 657 AVCodec png_decoder = { |
646 "png", | 658 "png", |
647 CODEC_TYPE_VIDEO, | 659 CODEC_TYPE_VIDEO, |
648 CODEC_ID_PNG, | 660 CODEC_ID_PNG, |
649 sizeof(PNGDecContext), | 661 sizeof(PNGDecContext), |
650 png_dec_init, | 662 png_dec_init, |
651 NULL, | 663 NULL, |
652 NULL, //decode_end, | 664 png_dec_end, |
653 decode_frame, | 665 decode_frame, |
654 CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/, | 666 CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/, |
655 NULL, | 667 NULL, |
656 .long_name = NULL_IF_CONFIG_SMALL("PNG image"), | 668 .long_name = NULL_IF_CONFIG_SMALL("PNG image"), |
657 }; | 669 }; |