Browse code

avfilter/vf_hqdn3: use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/05/14 13:17:05
Showing 1 changed files
... ...
@@ -133,7 +133,7 @@ static void denoise_depth(HQDN3DContext *s,
133 133
     uint16_t *frame_ant = *frame_ant_ptr;
134 134
     if (!frame_ant) {
135 135
         uint8_t *frame_src = src;
136
-        *frame_ant_ptr = frame_ant = av_malloc(w*h*sizeof(uint16_t));
136
+        *frame_ant_ptr = frame_ant = av_malloc_array(w, h*sizeof(uint16_t));
137 137
         for (y = 0; y < h; y++, src += sstride, frame_ant += w)
138 138
             for (x = 0; x < w; x++)
139 139
                 frame_ant[x] = LOAD(x);
... ...
@@ -259,7 +259,7 @@ static int config_input(AVFilterLink *inlink)
259 259
     s->vsub  = desc->log2_chroma_h;
260 260
     s->depth = desc->comp[0].depth_minus1+1;
261 261
 
262
-    s->line = av_malloc(inlink->w * sizeof(*s->line));
262
+    s->line = av_malloc_array(inlink->w, sizeof(*s->line));
263 263
     if (!s->line)
264 264
         return AVERROR(ENOMEM);
265 265