mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-18 21:45:10 +00:00
avcodec/mjpegdec: check for malloc failure of blocks[] and last_nnz[]
Fixes null pointer dereference Fixes Ticket2947 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
23bd0335af
commit
6c07e41f43
@ -507,6 +507,8 @@ unk_pixfmt:
|
||||
av_freep(&s->last_nnz[i]);
|
||||
s->blocks[i] = av_malloc(size * sizeof(**s->blocks));
|
||||
s->last_nnz[i] = av_mallocz(size * sizeof(**s->last_nnz));
|
||||
if (!s->blocks[i] || !s->last_nnz[i])
|
||||
return AVERROR(ENOMEM);
|
||||
s->block_stride[i] = bw * s->h_count[i];
|
||||
}
|
||||
memset(s->coefs_finished, 0, sizeof(s->coefs_finished));
|
||||
|
Loading…
Reference in New Issue
Block a user