]> git.sesse.net Git - ffmpeg/commitdiff
avdevice/lavfi: av_malloc -> av_malloc_array
authorLimin Wang <lance.lmwang@gmail.com>
Thu, 17 Sep 2020 14:05:17 +0000 (22:05 +0800)
committerLimin Wang <lance.lmwang@gmail.com>
Mon, 21 Sep 2020 01:30:55 +0000 (09:30 +0800)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
libavdevice/lavfi.c

index a4b510ff975ec0fc02e4df34a8781f2f2165c67c..ff0be640b1295e05f4092f261f6aed8dc799a67f 100644 (file)
@@ -69,7 +69,7 @@ static int *create_all_formats(int n)
             count++;
     }
 
-    if (!(fmts = av_malloc((count+1) * sizeof(int))))
+    if (!(fmts = av_malloc_array(count + 1, sizeof(*fmts))))
         return NULL;
     for (j = 0, i = 0; i < n; i++) {
         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);