diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index d2a782e8dd508316934b2918fabc46bd714b2380..9eeb8365233357d257e51df20489717221e8f56b 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -354,7 +354,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
         }
     }
 
-    pctx->ch = av_mallocz(sizeof(AacPsyChannel) * ctx->avctx->channels);
+    pctx->ch = av_mallocz_array(ctx->avctx->channels, sizeof(AacPsyChannel));
 
     lame_window_init(pctx, ctx->avctx);