[FFmpeg-devel] [PATCH 4/5] ogg: allow streams to update metadata

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Oct 20 15:05:42 CEST 2013

On Sun, Oct 20, 2013 at 12:29:47PM +0200, wm4 wrote:
> Not sure why you'd claim that it improves the situation with dangling
> pointers, because at this point you already lost, and it'll probably be
> harder to debug.

It will tend to cause one of
1) A crash due to NULL pointer dereference, which is much easier to
debug than something that may or may not crash depending on whether
the free of the struct it is inside just happened to unmap the page or
2) Trigger some ifs so we don't use it, limiting the use-after-free to
that struct instead of letting it run wild even further.
3) It reduces dependencies. Using av_free instead of av_freep is only
ok because of a following av_free, were someone to remove the second
av_free it would become bad/invalid code. Self-contained code is better.
Which is kind of the reason why we have av_freep in the first place.

So I do consider it effective as part of a defense-in-depth approach to
leave "dead" pointers around as little as possible.

> > I see that Michael changed it already so I guess the discussion is kind of moot though.
> True.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list