[FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.
Carl Eugen Hoyos
ceffmpeg at gmail.com
Mon Mar 11 10:36:44 EET 2019
2019-03-11 5:17 GMT+01:00, Sun, Jing A <jing.a.sun at intel.com>:
> 2019-03-08 11:36 GMT+01:00, Jing SUN <jing.a.sun at intel.com>:
>
>> +static void free_buffer(SvtContext *svt_enc) {
>> + EB_H265_ENC_INPUT *in_data =
>> (EB_H265_ENC_INPUT *)svt_enc->in_buf.pBuffer;
>
> Is the cast necessary?
> Or actually: Can't in_data be whatever doesn't produce a warning?
> [SUN, Jing] Yes, it's necessary, because the type of pBuffer is uint8_t* in
> libsvt_hevc.
You could make in_data uint8_t*.
>> +
>> + if (in_data)
>> + av_freep(&in_data);
>
> 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 remove the condition (or the function).
Please fix your quoting, Carl Eugen
More information about the ffmpeg-devel
mailing list