[FFmpeg-devel] [PATCH 3/3] avdevice/lavfi: av_malloc -> av_malloc_array

lance.lmwang at gmail.com lance.lmwang at gmail.com
Fri Sep 18 04:04:26 EEST 2020


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavdevice/lavfi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index a4b510f..ff0be64 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -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);
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list