[MPlayer-dev-eng] mplayer terminating

Peter Kostouros kpeter at melbpc.org.au
Sun Apr 7 03:37:33 CEST 2002


Hi

CVS'ed a few hour ago and found mplayer terminating after the first file 
completed its run. Problem was with play_tree_free_list (playlist.c) 
freeing memory; hope the following helps:

*** playtree.c.orig	Sun Apr  7 08:37:34 2002
--- playtree.c	Sun Apr  7 11:22:37 2002
***************
*** 19,25 ****
    play_tree_t* r = (play_tree_t*)calloc(1,sizeof(play_tree_t));
    if(r == NULL)
      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",sizeof(play_tree_t));
!   r->entry_type = PLAY_TREE_ENTRY_NODE;
    return r;
  }
  
--- 19,25 ----
    play_tree_t* r = (play_tree_t*)calloc(1,sizeof(play_tree_t));
    if(r == NULL)
      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",sizeof(play_tree_t));
!   r->entry_type = PLAY_TREE_ENTRY_NODE;    
    return r;
  }
  
***************
*** 56,61 ****
--- 56,62 ----
  void
  play_tree_free_list(play_tree_t* pt, int childs) {
    play_tree_t* iter;
+   play_tree_t* next;
  
  #ifdef MP_DEBUG
    assert(pt != NULL);
***************
*** 64,70 ****
    for(iter = pt ; iter->prev != NULL ; iter = iter->prev)
      /* NOTHING */;
  
!   for( ; iter != NULL ; iter = iter->next)
      play_tree_free(iter,childs);
      
  
--- 65,71 ----
    for(iter = pt ; iter->prev != NULL ; iter = iter->prev)
      /* NOTHING */;
  
!   for(next = iter->next; iter != NULL ; iter = next)
      play_tree_free(iter,childs);
      
  






More information about the MPlayer-dev-eng mailing list