// build a path for files referenced in .cue
strncpy(filepath, cuename, sizeof(filepath));
- tmp = strrchr(filepath, '/') + 1;
- if (tmp == NULL)
- tmp = strrchr(filepath, '\\') + 1;
+ tmp = strrchr(filepath, '/');
if (tmp == NULL)
+ tmp = strrchr(filepath, '\\');
+ if (tmp != NULL)
+ tmp++;
+ else
tmp = filepath;
*tmp = 0;
filepath[sizeof(filepath) - 1] = 0;
}
}
numtracks = 0;
+ ti[1].type = 0;
UnloadSBI();
+ memset(cdbuffer, 0, sizeof(cdbuffer));
+ CDR_getBuffer = ISOgetBuffer;
+
return 0;
}
// uses bcd format
static long CALLBACK ISOreadTrack(unsigned char *time) {
int sector = MSF2SECT(btoi(time[0]), btoi(time[1]), btoi(time[2]));
+ long ret;
if (cdHandle == NULL) {
return -1;
}
}
- cdimg_read_func(cdHandle, 0, cdbuffer, sector);
+ ret = cdimg_read_func(cdHandle, 0, cdbuffer, sector);
+ if (ret < 0)
+ return -1;
if (subHandle != NULL) {
fseek(subHandle, sector * SUB_FRAMESIZE, SEEK_SET);