avcodec/atrac3plusdec: Use av_mallocz_array()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 21 May 2014 14:00:14 +0000 (16:00 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 21 May 2014 14:03:22 +0000 (16:03 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/atrac3plusdec.c

index 652bd78..3a6b3cf 100644 (file)
@@ -166,8 +166,8 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
 
     ctx->my_channel_layout = avctx->channel_layout;
 
-    ctx->ch_units = av_mallocz(sizeof(*ctx->ch_units) *
-                               ctx->num_channel_blocks);
+    ctx->ch_units = av_mallocz_array(ctx->num_channel_blocks, sizeof(*ctx->ch_units));
+
     if (!ctx->ch_units) {
         atrac3p_decode_close(avctx);
         return AVERROR(ENOMEM);