comparison 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
comparison
equal deleted inserted replaced
670:c92018172bfb 671:e6a1ba5185ba
225 } 225 }
226 #endif 226 #endif
227 227
228 /* I've seen some flac files beginning with id3 frames.. 228 /* I've seen some flac files beginning with id3 frames..
229 so let's exclude known non-mp3 filename extensions */ 229 so let's exclude known non-mp3 filename extensions */
230 if (!strcasecmp("flac", ext) || !strcasecmp("mpc", ext) || 230 if ((ext != NULL) &&
231 !strcasecmp("tta", ext) || !strcasecmp("ogg", ext) || 231 (!strcasecmp("flac", ext) || !strcasecmp("mpc", ext) ||
232 !strcasecmp("wma", ext) ) 232 !strcasecmp("tta", ext) || !strcasecmp("ogg", ext) ||
233 !strcasecmp("wma", ext) )
234 )
233 return FALSE; 235 return FALSE;
234 236
235 if (fin == NULL) 237 if (fin == NULL)
236 return FALSE; 238 return FALSE;
237 239