1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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

View File

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