> -----Original Message-----
> From: ffmpeg-devel [mailto:[email protected]] On Behalf
> Of James Almer
> Sent: Friday, May 10, 2019 12:05 PM
> To: [email protected]
> 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
The better solution should be: use av_malloc and just memset the padding bytes.
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to