-----Original Message-----
From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of James 
Almer
Sent: Friday, May 10, 2019 12:05 PM
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v12 1/2] lavc/svt_hevc: add libsvt hevc 
encoder wrapper

>You used av_mallocz() to allocate the buffer, so it's already fully zeroed.
>In any case, it would be faster to instead use av_malloc() above, then only 
>zero the padding bytes here. Since you're copying the actual data in the line 
>below, nothing will remain uninitialized.

Hi Almer,

Thanks for the review! Indeed the explicit memset() is redundant and I have 
removed that.

void *av_mallocz(size_t size)
{
    void *ptr = av_malloc(size);
    if (ptr)
        memset(ptr, 0, size);
    return ptr;
}

-Jing
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to