[FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Mar 11 11:01:25 EET 2019


2019-03-11 9:49 GMT+01:00, Moritz Barsnick <barsnick at gmx.net>:
> On Mon, Mar 11, 2019 at 04:17:21 +0000, Sun, Jing A wrote:
>> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
>> Carl Eugen Hoyos
>> > The condition is unnecessary.
>> [SUN, Jing] If av_mallocz fails, free_buffer will be called with in_data
>> being NULL. Checking it avoids unnecessary calling to av_freep in that
>> case.
>
> Please read the kind documentation (and the "Note" quzoted below) or
> the source of said function, and how other uses within ffmpeg are:
>
> https://www.ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#ga0cc84043ea2167ad005c86e11d0bcdba
>
>     void av_freep (void *ptr)
>     [...]
>     Note
>         *ptr = NULL is safe and leads to no action.

> In other words, av_freep() already has this check.

I believe his argumentation was that he knows but that in case
of oom, he wants to avoid extra indirections.

Carl Eugen


More information about the ffmpeg-devel mailing list