Commit 34bbab43 authored by Michael Niedermayer's avatar Michael Niedermayer

jpeglsnec: fix memleak of state in error case

Fixes CID733794
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 104b1d9e
......@@ -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){
......
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