Fix for CUE/BIN crash on bad filename, fix for crash-on-exit because of the bad sb_parts count (12 i/o sb_parts.)

This commit is contained in:
waltje
2017-06-13 13:44:51 -04:00
parent eda2a004fd
commit 7db0c897a5
3 changed files with 211 additions and 2 deletions

View File

@@ -68,6 +68,7 @@ bool CDROM_Interface_Image::BinaryFile::read(Bit8u *buffer, uint64_t seek, uint6
{
uint64_t offs = 0;
file = fopen64(fn, "rb");
if (file == NULL) return 0;
fseeko64(file, seek, SEEK_SET);
offs = fread(buffer, 1, count, file);
fclose(file);
@@ -79,6 +80,7 @@ uint64_t CDROM_Interface_Image::BinaryFile::getLength()
{
uint64_t ret = 0;
file = fopen64(fn, "rb");
if (file == NULL) return 0;
fseeko64(file, 0, SEEK_END);
ret = ftello64(file);
fclose(file);