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);