diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 4d6c3370..89de619f 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -534,11 +534,18 @@ static int parsetoc(const char *isofile) { } } } - if (numtracks > 0) - cdHandle = fopen(filename, "rb"); fclose(fi); + if (numtracks > 0) { + // Test if the data file pointed to in the toc/cue file can be opened. + fi = fopen(filename, "rb"); + if (fi != NULL) { + fclose(cdHandle); + cdHandle = fi; + } + } + return 0; }