if (ext == NULL || (strcmp(ext, ".pbp") != 0 && strcmp(ext, ".PBP") != 0))
return -1;
+ fseek(cdHandle, 0, SEEK_SET);
+
numtracks = 0;
ret = fread(&pbp_hdr, 1, sizeof(pbp_hdr), cdHandle);
if (ext == NULL || (strcasecmp(ext + 1, ".cbn") != 0 && strcasecmp(ext, ".cbin") != 0))
return -1;
+ fseek(cdHandle, 0, SEEK_SET);
+
ret = fread(&ciso_hdr, 1, sizeof(ciso_hdr), cdHandle);
if (ret != sizeof(ciso_hdr)) {
SysPrintf("failed to read ciso header\n");