changeset 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 c92018172bfb
children ada6a5ad1851
files ChangeLog src/madplug/plugin.c
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Feb 18 03:38:05 2007 -0800
+++ b/ChangeLog	Sun Feb 18 14:51:23 2007 -0800
@@ -1,3 +1,11 @@
+2007-02-18 11:38:05 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [1426]
+  - don't crash on startup by passing NULL to opendir(2)
+  
+  trunk/src/lame/out_lame.c |    2 +-
+  1 file changed, 1 insertion(+), 1 deletion(-)
+
+
 2007-02-18 08:09:31 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
   revision [1424]
   - remove .depend
--- 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)