[MPlayer-dev-eng] [PATCH] demux_close_xmms segfault

Alexander Gottwald Alexander.Gottwald at s1999.tu-chemnitz.de
Wed Dec 25 02:27:30 CET 2002


hi,

The patch fixes a nullpointer dereference and free of NULL in demux_close_xmms
when no matching plugin was found.

bye
    ago
-- 
 Alexander.Gottwald at informatik.tu-chemnitz.de 
 http://www.gotti.org           ICQ: 126018723
-------------- next part --------------
diff -u -r ../../SOURCES/MPlayer-cvs/libmpdemux/demux_xmms.c libmpdemux/demux_xmms.c
--- ../../SOURCES/MPlayer-cvs/libmpdemux/demux_xmms.c	Mon Dec 23 23:13:46 2002
+++ libmpdemux/demux_xmms.c	Wed Dec 25 02:21:19 2002
@@ -326,8 +326,11 @@
   xmms_priv_t *priv=demuxer->priv;
   xmms_playing=0;
   xmms_audiopos=0; // xmp on exit waits until buffer is free enough
-  priv->ip->stop();
-  free(priv); xmms_priv=demuxer->priv=NULL;
+  if (priv != NULL) {
+    if (priv->ip != NULL)
+      priv->ip->stop();
+    free(priv); xmms_priv=demuxer->priv=NULL;
+  }
   cleanup_plugins();
   return 1;
 }


More information about the MPlayer-dev-eng mailing list