[FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

Nicolas George george at nsup.org
Fri Aug 23 22:28:23 EEST 2019


Juan De León (12019-08-23):
> I changed it to an inline function, returns SIZE_MAX if it fails to make
> av_malloc() fail and return NULL.

You neglected to check for SIZE_MAX afterwards. I suspect there are
architectures where such a malloc could succeed.

If you insist on a function rather than a macro, I personally consider
bad style to rely on a magic value for error: return a boolean for
success and pass the size through a pointer.

But in this case, a macro would probably be the simplest.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190823/fd4c4e87/attachment.sig>


More information about the ffmpeg-devel mailing list