diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-11 19:44:58 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-11 19:44:58 +0400 |
commit | 34bbab432ca049ec0a5b9accf6b965b1b1d63b2b (patch) | |
tree | 27fc73780e8d47201afb0a40020c5e9461ad0b4f | |
parent | 104b1d9e103f90485e894b20dd5bb3f1964fe5f3 (diff) |
jpeglsnec: fix memleak of state in error case
Fixes CID733794
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/jpeglsenc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c index 180f7c905c..17fb8180a7 100644 --- a/libavcodec/jpeglsenc.c +++ b/libavcodec/jpeglsenc.c @@ -293,8 +293,10 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, ls_store_lse(state, &pb); zero = av_mallocz(FFABS(p->linesize[0])); - if (!zero) + if (!zero) { + av_free(state); return AVERROR(ENOMEM); + } last = zero; cur = p->data[0]; if(avctx->pix_fmt == AV_PIX_FMT_GRAY8){ |