avdevice/lavfi: av_malloc -> av_malloc_array

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
Limin Wang 2020-09-17 22:05:17 +08:00
parent a554adaab8
commit 6c8ff1838d
1 changed files with 1 additions and 1 deletions

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