[FFmpeg-devel] [PATCH] vf_overlay: clear cur_buf only in end_frame.

Michael Niedermayer michaelni at gmx.at
Fri Jul 27 19:26:13 CEST 2012


On Fri, Jul 27, 2012 at 05:35:55PM +0200, Nicolas George wrote:
> Le decadi 10 thermidor, an CCXX, Michael Niedermayer a écrit :
> > this looks fragile, implicating from the value of out_buf if
> > cur_buf has been copied
> > it might make more sense to create a new reference so the original
> > can saftely be freed or add a seperate flag that indicates if cur_buf
> > has to be set to NULL before returning
> 
> I am afraid the flag solution would be fragile too, especially with merges
> from the fork bringing similar problems.
> 
> As for creating a new reference for the copy, this is robust, but it is also
> somewhat expensive, in a part of the code that is starting to be
> speed-critical. I believe it is too high a price to pay for for letting the
> programmer be sloppy.
> 
> It is not hard to be sure cur_buf was cleared in end_frame and not in
> start_frame, once the problem is clearly understood. A checklist in the docs
> and a few well-placed av_asserts would, IMHO, be enough to make sure
> everything is fine.

ok with me if its checked by some assert somewhere

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120727/eb405256/attachment.asc>


More information about the ffmpeg-devel mailing list