[FFmpeg-devel] [PATCH] avcodec/svq1dec: use av_malloc_array() to allocate pmv

Guangxin Xu oddstone at gmail.com
Thu Sep 17 17:11:57 EEST 2020


On Thu, Sep 17, 2020 at 10:00 PM Paul B Mahol <onemda at gmail.com> wrote:

> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/svq1dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
> index 25bd3d0253..ddd02f354e 100644
> --- a/libavcodec/svq1dec.c
> +++ b/libavcodec/svq1dec.c
> @@ -679,7 +679,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
> void *data,
>      if (result < 0)
>          return result;
>
> -    pmv = av_malloc((FFALIGN(s->width, 16) / 8 + 3) * sizeof(*pmv));
> +    pmv = av_malloc_array((FFALIGN(s->width, 16) / 8 + 3), sizeof(*pmv));
>
nit, the() for first param is not needed.


>      if (!pmv)
>          return AVERROR(ENOMEM);
>
> --
> 2.17.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