[FFmpeg-devel] [PATCH] lavc/mss1: fix mem leak in case of init failure
Lukasz Marek
lukasz.m.luki2 at gmail.com
Sat Nov 22 22:57:05 CET 2014
Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
---
libavcodec/mss1.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c
index 6bb524b..2eb67df 100644
--- a/libavcodec/mss1.c
+++ b/libavcodec/mss1.c
@@ -197,6 +197,8 @@ static av_cold int mss1_decode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM);
ret = ff_mss12_decode_init(&c->ctx, 0, &c->sc, NULL);
+ if (ret < 0)
+ av_frame_free(&c->pic);
avctx->pix_fmt = AV_PIX_FMT_PAL8;
--
1.9.1
More information about the ffmpeg-devel
mailing list