Commit 8532566e authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mjpegdec: use av_mallocz_array()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1e25afc1
......@@ -562,8 +562,8 @@ 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_mallocz(size * sizeof(**s->blocks));
s->last_nnz[i] = av_mallocz(size * sizeof(**s->last_nnz));
s->blocks[i] = av_mallocz_array(size, sizeof(**s->blocks));
s->last_nnz[i] = av_mallocz_array(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];
......
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