[MPlayer-dev-eng] [PATCH] segfault in playtree.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Aug 6 00:00:11 CEST 2010


On Thu, Aug 05, 2010 at 12:39:52AM -0400, Reinhard Tartler wrote:
> Hi Folks,
> 
> This is a patch from Adrian Knoth <adi at drcomp.erfurt.thur.de> to fix a
> segfault on empty playlists.
> 
> This is Debian Bug: http://bugs.debian.org/591525
> 
> Index: playtree.c
> ===================================================================
> --- playtree.c	(revision 31912)
> +++ playtree.c	(working copy)
> @@ -223,6 +223,13 @@
>    assert(pt->entry_type == PLAY_TREE_ENTRY_NODE);
>  #endif
>  
> +  /* Roughly validate input data. Both, pt and child are going to be
> +   * dereferenced, hence assure they're not NULL.
> +   */
> +  if (NULL == pt || NULL == child) {
> +      return;
> +  }
> +
>    //DEBUG_FF: Where are the children freed?
>    // Attention in using this function!
>    for(iter = pt->child ; iter != NULL ; iter = iter->next)

Think I replied to the wrong place first: I think this is the wrong
place, at least it must be before the asserts.


More information about the MPlayer-dev-eng mailing list