Commit 0b7f39c9 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Release unreleased buffers found by make test.

Originally committed as revision 20251 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bc2d2a07
...@@ -1185,6 +1185,9 @@ static av_cold int decode_end(AVCodecContext *avctx) ...@@ -1185,6 +1185,9 @@ static av_cold int decode_end(AVCodecContext *avctx)
HYuvContext *s = avctx->priv_data; HYuvContext *s = avctx->priv_data;
int i; int i;
if (s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
common_end(s); common_end(s);
av_freep(&s->bitstream_buffer); av_freep(&s->bitstream_buffer);
......
...@@ -1494,6 +1494,9 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) ...@@ -1494,6 +1494,9 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
MJpegDecodeContext *s = avctx->priv_data; MJpegDecodeContext *s = avctx->priv_data;
int i, j; int i, j;
if (s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
av_free(s->buffer); av_free(s->buffer);
av_free(s->qscale_table); av_free(s->qscale_table);
......
...@@ -328,6 +328,15 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu ...@@ -328,6 +328,15 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
return s->bytestream - s->bytestream_start; return s->bytestream - s->bytestream_start;
} }
static av_cold int common_end(AVCodecContext *avctx){
PNMContext *s = avctx->priv_data;
if (s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
return 0;
}
#if 0 #if 0
static int pnm_probe(AVProbeData *pd) static int pnm_probe(AVProbeData *pd)
{ {
...@@ -371,7 +380,7 @@ AVCodec pgm_decoder = { ...@@ -371,7 +380,7 @@ AVCodec pgm_decoder = {
sizeof(PNMContext), sizeof(PNMContext),
common_init, common_init,
NULL, NULL,
NULL, common_end,
pnm_decode_frame, pnm_decode_frame,
CODEC_CAP_DR1, CODEC_CAP_DR1,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE}, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE},
...@@ -400,7 +409,7 @@ AVCodec pgmyuv_decoder = { ...@@ -400,7 +409,7 @@ AVCodec pgmyuv_decoder = {
sizeof(PNMContext), sizeof(PNMContext),
common_init, common_init,
NULL, NULL,
NULL, common_end,
pnm_decode_frame, pnm_decode_frame,
CODEC_CAP_DR1, CODEC_CAP_DR1,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
...@@ -429,7 +438,7 @@ AVCodec ppm_decoder = { ...@@ -429,7 +438,7 @@ AVCodec ppm_decoder = {
sizeof(PNMContext), sizeof(PNMContext),
common_init, common_init,
NULL, NULL,
NULL, common_end,
pnm_decode_frame, pnm_decode_frame,
CODEC_CAP_DR1, CODEC_CAP_DR1,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE}, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE},
...@@ -458,7 +467,7 @@ AVCodec pbm_decoder = { ...@@ -458,7 +467,7 @@ AVCodec pbm_decoder = {
sizeof(PNMContext), sizeof(PNMContext),
common_init, common_init,
NULL, NULL,
NULL, common_end,
pnm_decode_frame, pnm_decode_frame,
CODEC_CAP_DR1, CODEC_CAP_DR1,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE}, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE},
...@@ -487,7 +496,7 @@ AVCodec pam_decoder = { ...@@ -487,7 +496,7 @@ AVCodec pam_decoder = {
sizeof(PNMContext), sizeof(PNMContext),
common_init, common_init,
NULL, NULL,
NULL, common_end,
pnm_decode_frame, pnm_decode_frame,
CODEC_CAP_DR1, CODEC_CAP_DR1,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE}, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment