From 6c8ff1838d1384609f865fc3074cb5cf65aa6ba8 Mon Sep 17 00:00:00 2001 From: Limin Wang Date: Thu, 17 Sep 2020 22:05:17 +0800 Subject: [PATCH] avdevice/lavfi: av_malloc -> av_malloc_array Reviewed-by: Paul B Mahol Reviewed-by: Nicolas George Signed-off-by: Limin Wang --- libavdevice/lavfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index a4b510ff97..ff0be640b1 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);