提交 7c191dfb 编写于 作者: M Michael Niedermayer

avcodec/j2kenc: Only allocate cblk.data once

Fixes: memleak
Found-by: <jamrial>
Signed-off-by: NMichael Niedermayer <michael@niedermayer.cc>
上级 efb51c8e
......@@ -938,7 +938,8 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
}
}
}
prec->cblk[cblkno].data = av_malloc(1 + 8192);
if (!prec->cblk[cblkno].data)
prec->cblk[cblkno].data = av_malloc(1 + 8192);
if (!prec->cblk[cblkno].data)
return AVERROR(ENOMEM);
encode_cblk(s, &t1, prec->cblk + cblkno, tile, xx1 - xx0, yy1 - yy0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册