mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 08:12:44 +00:00
lavc/jpeglsenc: fix allocation in case of negative linesize, and add malloc check
Fix crash with negative linesizes, fix trac ticket #1078.
This commit is contained in:
parent
a41340f8e8
commit
0ca15aa066
@ -295,7 +295,9 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
|
||||
|
||||
ls_store_lse(state, &pb);
|
||||
|
||||
zero = av_mallocz(p->linesize[0]);
|
||||
zero = av_mallocz(FFABS(p->linesize[0]));
|
||||
if (!zero)
|
||||
return AVERROR(ENOMEM);
|
||||
last = zero;
|
||||
cur = p->data[0];
|
||||
if(avctx->pix_fmt == PIX_FMT_GRAY8){
|
||||
|
Loading…
Reference in New Issue
Block a user