From a83a94ea9c8ca260ed8422d08df0c61f93e7ecf6 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Wed, 21 Mar 2007 21:38:55 +0000 Subject: [PATCH] Add a bit more error checking to prevent possible crashes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12880 a1c6a512-1295-4272-9138-f99709370657 --- apps/cuesheet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/cuesheet.c b/apps/cuesheet.c index 2f36ff0212..b05ff2493b 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c @@ -252,14 +252,14 @@ static void browse_cuesheet(struct cuesheet *cue) gui_synclist_set_nb_items(&lists, 2*cue->track_count); gui_synclist_set_title(&lists, title, 0); - if (strcmp(id3->path, "No file!")) + if (id3 && *id3->path && strcmp(id3->path, "No file!")) { strncpy(cuepath, id3->path, MAX_PATH); dot = strrchr(cuepath, '.'); strcpy(dot, ".cue"); } - if (id3->cuesheet_type && !strcmp(cue->path, cuepath)) + if (id3 && id3->cuesheet_type && !strcmp(cue->path, cuepath)) { gui_synclist_select_item(&lists, 2*cue_find_current_track(cue, id3->elapsed));