diff mbox series

[FFmpeg-devel,3/3] avdevice/lavfi: av_malloc -> av_malloc_array

Message ID 1600391066-15693-3-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 6c8ff1838d1384609f865fc3074cb5cf65aa6ba8
Headers show
Series [FFmpeg-devel,1/3] avdevice/lavfi: fix FIXME and check a/v type by codec_type
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Limin Wang Sept. 18, 2020, 1:04 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavdevice/lavfi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Sept. 18, 2020, 8:15 a.m. UTC | #1
On Fri, Sep 18, 2020 at 09:04:26AM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@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@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Nicolas George Sept. 20, 2020, 3:21 p.m. UTC | #2
lance.lmwang@gmail.com (12020-09-18):
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavdevice/lavfi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM.

Regards,
diff mbox series

Patch

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