[FFmpeg-devel] [PATCH 3/3] avdevice/lavfi: av_malloc -> av_malloc_array
Paul B Mahol
onemda at gmail.com
Fri Sep 18 11:15:43 EEST 2020
On Fri, Sep 18, 2020 at 09:04:26AM +0800, lance.lmwang at gmail.com wrote:
> 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(-)
lgtm
>
> 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
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list