]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_fieldmatch: use av_malloc_array()
authorPaul B Mahol <onemda@gmail.com>
Thu, 21 Jan 2021 11:28:13 +0000 (12:28 +0100)
committerPaul B Mahol <onemda@gmail.com>
Thu, 21 Jan 2021 12:37:47 +0000 (13:37 +0100)
libavfilter/vf_fieldmatch.c

index 57ecf738641f69bf9f2f6c2b59097d31d02221a1..528f943172f5ef1738fd6a8bba4b11ac9c96c01d 100644 (file)
@@ -951,8 +951,8 @@ static int config_input(AVFilterLink *inlink)
     fm->tpitchuv = FFALIGN(w >> 1, 16);
 
     fm->tbuffer = av_calloc((h/2 + 4) * fm->tpitchy, sizeof(*fm->tbuffer));
-    fm->c_array = av_malloc((((w + fm->blockx/2)/fm->blockx)+1) *
-                            (((h + fm->blocky/2)/fm->blocky)+1) *
+    fm->c_array = av_malloc_array((((w + fm->blockx/2)/fm->blockx)+1) *
+                            (((h + fm->blocky/2)/fm->blocky)+1),
                             4 * sizeof(*fm->c_array));
     if (!fm->tbuffer || !fm->c_array)
         return AVERROR(ENOMEM);