[FFmpeg-devel] [PATCH] avutil/frame: Assert that width/height/channels is 0 for the destination of av_frame*_ref()

Nicolas George george at nsup.org
Wed Mar 9 10:39:36 CET 2016


Le decadi 20 ventôse, an CCXXIV, Clement Boesch a écrit :
> That's a good idea but downstream developers might prefer their users to
> experience a memleak that random violent aborts. I would probably make it
> at assert level 1.

Assert level 0 and 1 are equivalent from an API point of view: they both
mean (in this case when testing value provided by the caller) that the
provided value is invalid on pain of undefined behaviour.

On the other hand, this was not currently true nor documented: using these
functions with a destination that contains garbage is not illegal according
with doxy and works currently well. Thing is, currently, users can not have
a frame with garbage unless they do it on purpose: either it contains valid
pointers or it is cleared.

At the very least, this change would require updating the doxy accordingly.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160309/c46c61ab/attachment.sig>


More information about the ffmpeg-devel mailing list