diff src/madplug/plugin.c @ 671:e6a1ba5185ba trunk

[svn] - Tweak to check we found a file extension before using it to prevent segfault
author nazca
date Sun, 18 Feb 2007 14:51:23 -0800
parents 638b290641f3
children fadf4c18a1cf
line wrap: on
line diff
--- a/src/madplug/plugin.c	Sun Feb 18 03:38:05 2007 -0800
+++ b/src/madplug/plugin.c	Sun Feb 18 14:51:23 2007 -0800
@@ -227,9 +227,11 @@
 
     /* I've seen some flac files beginning with id3 frames..
        so let's exclude known non-mp3 filename extensions */
-    if (!strcasecmp("flac", ext) || !strcasecmp("mpc", ext) ||
-        !strcasecmp("tta", ext) || !strcasecmp("ogg", ext) ||
-	!strcasecmp("wma", ext) )
+    if ((ext != NULL) && 
+        (!strcasecmp("flac", ext) || !strcasecmp("mpc", ext) ||
+         !strcasecmp("tta", ext)  || !strcasecmp("ogg", ext) ||
+         !strcasecmp("wma", ext) )
+			 )
         return FALSE;
 
     if (fin == NULL)