From 9ca4ac55ba483f41d1cd36082db2de7940fccffd Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Wed, 2 Aug 2006 23:37:08 +0000 Subject: [PATCH] Fix for crash on empty extension, as reported by Denis in forums --- src/mp3-scanner.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mp3-scanner.c b/src/mp3-scanner.c index f07c5cf1..5c81d553 100644 --- a/src/mp3-scanner.c +++ b/src/mp3-scanner.c @@ -572,9 +572,9 @@ void scan_filename(char *path, int compdir, char *extensions) { DPRINTF(E_WARN,L_SCAN,"Error statting: %s\n",strerror(errno)); } else { /* we assume this is regular file */ - if(strlen(fname) > 4) { + if(strlen(fname) > 2) { ext = strrchr(fname, '.'); - if(ext) { + if(ext && ((int)strlen(ext) > 1)) { if(strcasecmp(".m3u",ext) == 0) { scan_add_playlistlist(mp3_path); } else if(strcasecmp(".xml",ext) == 0) { @@ -622,7 +622,7 @@ void scan_music_file(char *path, char *fname, if((fname) && (strlen(fname) > 1) && (fname[strlen(fname)-1] != '.')) { type = strrchr(fname, '.') + 1; - if(type) { + if(type && *type) { /* see if there is "official" format and info for it */ ptaghandler=scan_gethandler(type); if(ptaghandler) {