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

Michael Niedermayer michael at niedermayer.cc
Wed Mar 9 12:57:20 CET 2016


On Wed, Mar 09, 2016 at 10:39:36AM +0100, Nicolas George wrote:
> 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.

wm4 posted a patch to document the undefied-ness of this
0301 19:21 wm4             (2.4K) ├─>[FFmpeg-devel] [PATCH 1/6] lavu: improve documentation of some AVFrame functions

is that sufficient, or should further documentation be added ?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160309/68b4dc53/attachment.sig>


More information about the ffmpeg-devel mailing list