[MPlayer-dev-eng] [PATCH] Fix segmentation fault when pressing U (stop playing) in GUI

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Jun 6 17:10:44 CEST 2011


On Mon, Jun 06, 2011 at 04:31:43PM +0200, Ingo Brückl wrote:
> Reimar Döffinger wrote on Mon, 6 Jun 2011 15:02:21 +0200:
> 
> > More robust code would be for the condition that causes
> > the crash and return "not available" or whatever the
> > appropriate return value is.
> 
> I'm not sure that I get the point.

Splitting crash-bug-fixes from adding features.
That in particular fixes the very common case of people
adding a whole bunch of code specifically tuned to handle
a single special case to avoid a crash when they would have
achieved 99% the same effect by adding a single if.
Unlikely here, but it would still be interesting to
see what happens when you just add this

> -#ifdef MP_DEBUG
> -  assert(iter != NULL);
> -#endif
> +  if (!iter) return;

also to play_tree_iter_up_step.
Since MP_DEBUG is not enabled by default it's not strictly
necessary to remove the assert, though it's probably cleaner.


More information about the MPlayer-dev-eng mailing list