]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/tta.c
avcodec/motionpixels: use av_mallocz_array()
[ffmpeg] / libavcodec / tta.c
index 19cdd8c7b23046594fb0c94dcb28cec9209de3ec..87bfe7b8118c19b33a1a139f8af70a4d9fea4ed5 100644 (file)
@@ -104,12 +104,12 @@ static int allocate_buffers(AVCodecContext *avctx)
     TTAContext *s = avctx->priv_data;
 
     if (s->bps < 3) {
-        s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
+        s->decode_buffer = av_mallocz_array(sizeof(int32_t)*s->frame_length, s->channels);
         if (!s->decode_buffer)
             return AVERROR(ENOMEM);
     } else
         s->decode_buffer = NULL;
-    s->ch_ctx = av_malloc(avctx->channels * sizeof(*s->ch_ctx));
+    s->ch_ctx = av_malloc_array(avctx->channels, sizeof(*s->ch_ctx));
     if (!s->ch_ctx) {
         av_freep(&s->decode_buffer);
         return AVERROR(ENOMEM);