changeset 8611:668161e96ab9

The patch fixes a nullpointer dereference and free of NULL in demux_close_xmms when no matching plugin was found. Alexander.Gottwald@informatik.tu-chemnitz.de
author arpi
date Sat, 28 Dec 2002 14:06:48 +0000
parents 097188da10d3
children a61d1b326beb
files libmpdemux/demux_xmms.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_xmms.c	Sat Dec 28 14:04:56 2002 +0000
+++ b/libmpdemux/demux_xmms.c	Sat Dec 28 14:06:48 2002 +0000
@@ -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;
 }