Commit 0c23ee13 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mjpegdec: use mallocz for progressive blocks

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f849c599487_6828_mjpeg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7d7a7013
......@@ -510,7 +510,7 @@ unk_pixfmt:
int size = bw * bh * s->h_count[i] * s->v_count[i];
av_freep(&s->blocks[i]);
av_freep(&s->last_nnz[i]);
s->blocks[i] = av_malloc(size * sizeof(**s->blocks));
s->blocks[i] = av_mallocz(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);
......
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