On Sun, Nov 23, 2014 at 10:10:10PM +0100, Lukasz Marek wrote: > On 23.11.2014 17:25, Michael Niedermayer wrote: > >On Sat, Nov 22, 2014 at 11:26:04PM +0100, Lukasz Marek wrote: > >>Signed-off-by: Lukasz Marek <lukasz.m.lu...@gmail.com> > >>--- > >> libavcodec/smvjpegdec.c | 9 ++++++++- > >> 1 file changed, 8 insertions(+), 1 deletion(-) > >> > >>diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c > >>index 69327cd..261a441 100644 > >>--- a/libavcodec/smvjpegdec.c > >>+++ b/libavcodec/smvjpegdec.c > >>@@ -89,8 +89,10 @@ static av_cold int smvjpeg_decode_init(AVCodecContext > >>*avctx) > >> return AVERROR(ENOMEM); > >> > >> s->picture[1] = av_frame_alloc(); > >>- if (!s->picture[1]) > >>+ if (!s->picture[1]) { > >>+ av_frame_free(&s->picture[0]); > >> return AVERROR(ENOMEM); > >>+ } > >> > >> s->jpg.picture_ptr = s->picture[0]; > >> > >>@@ -120,6 +122,11 @@ static av_cold int smvjpeg_decode_init(AVCodecContext > >>*avctx) > >> } > >> av_dict_free(&thread_opt); > >> > >>+ if (ret < 0) { > >>+ av_frame_free(&s->picture[0]); > >>+ av_frame_free(&s->picture[1]); > >>+ avcodec_free_context(&s->avctx); > >>+ } > >> return ret; > >> } > > > >LGTM, alternatively smvjpeg_decode_end() could probably be called on > >error > > Updated patch. The same comment as for huffyuvdec.c >
> smvjpegdec.c | 34 +++++++++++++++++++--------------- > 1 file changed, 19 insertions(+), 15 deletions(-) > 8056c79bc2b7f4e16743e8a3e902c85d2a89d5fc > 0002-lavc-smvjpegdec-fix-mem-leak-in-case-of-init-failure.patch > From 99c84f0ba91835b9ed4a8605333b386ecf880e0f Mon Sep 17 00:00:00 2001 > From: Lukasz Marek <lukasz.m.lu...@gmail.com> > Date: Sat, 22 Nov 2014 23:25:12 +0100 > Subject: [PATCH 2/2] lavc/smvjpegdec: fix mem leak in case of init failure LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel