Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix a possible crash in the cuesheet code if the filename lacks a slash, which happens for some reason I don't quite understand yet.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16229 a1c6a512-1295-4272-9138-f99709370657

+12 -2
+12 -2
apps/cuesheet.c
··· 76 76 bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path) 77 77 { 78 78 DEBUGF("look for cue file\n"); 79 + 79 80 char cuepath[MAX_PATH]; 81 + char *dot, *slash; 82 + 83 + slash = strrchr(trackpath, '/'); 84 + if (!slash) 85 + { 86 + found_cue_path = NULL; 87 + return false; 88 + } 89 + 80 90 strncpy(cuepath, trackpath, MAX_PATH); 81 - char *dot = strrchr(cuepath, '.'); 91 + dot = strrchr(cuepath, '.'); 82 92 strcpy(dot, ".cue"); 83 93 84 94 int fd = open(cuepath,O_RDONLY); 85 95 if (fd < 0) 86 96 { 87 97 strcpy(cuepath, CUE_DIR); 88 - strcat(cuepath, strrchr(trackpath, '/')); 98 + strcat(cuepath, slash); 89 99 char *dot = strrchr(cuepath, '.'); 90 100 strcpy(dot, ".cue"); 91 101 fd = open(cuepath,O_RDONLY);