avcodec/mjpegdec: use av_mallocz_array()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 30 Apr 2014 16:26:28 +0000 (18:26 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 30 Apr 2014 16:26:28 +0000 (18:26 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegdec.c

index 6b1a03b..1aaddd1 100644 (file)
@@ -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];