avfilter/vf_dctdnoiz: Use av_malloc_array()
authorPaul B Mahol <onemda@gmail.com>
Thu, 29 Jan 2015 14:15:21 +0000 (14:15 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sun, 1 Feb 2015 16:47:36 +0000 (16:47 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_dctdnoiz.c

index 5cce9cb..61438bb 100644 (file)
@@ -513,9 +513,9 @@ static int config_input(AVFilterLink *inlink)
 
     s->p_linesize = linesize = FFALIGN(s->pr_width, 32);
     for (i = 0; i < 2; i++) {
-        s->cbuf[i][0] = av_malloc(linesize * s->pr_height * sizeof(*s->cbuf[i][0]));
-        s->cbuf[i][1] = av_malloc(linesize * s->pr_height * sizeof(*s->cbuf[i][1]));
-        s->cbuf[i][2] = av_malloc(linesize * s->pr_height * sizeof(*s->cbuf[i][2]));
+        s->cbuf[i][0] = av_malloc_array(linesize * s->pr_height, sizeof(*s->cbuf[i][0]));
+        s->cbuf[i][1] = av_malloc_array(linesize * s->pr_height, sizeof(*s->cbuf[i][1]));
+        s->cbuf[i][2] = av_malloc_array(linesize * s->pr_height, sizeof(*s->cbuf[i][2]));
         if (!s->cbuf[i][0] || !s->cbuf[i][1] || !s->cbuf[i][2])
             return AVERROR(ENOMEM);
     }