CD-ROM: Report image backend I/O errors as media CRC errors to the drive

This commit is contained in:
RichardG867
2024-10-27 13:17:55 -03:00
parent 31beadd103
commit aeaaa09b16
8 changed files with 75 additions and 39 deletions

View File

@@ -716,8 +716,11 @@ viso_read(void *priv, uint8_t *buffer, uint64_t seek, size_t count)
}
/* Read data. */
if (entry->file && (fseeko64(entry->file, seek - entry->data_offset, SEEK_SET) != -1))
read = fread(buffer, 1, sector_remain, entry->file);
if (!entry->file || (fseeko64(entry->file, seek - entry->data_offset, SEEK_SET) == -1))
return -1;
read = fread(buffer, 1, sector_remain, entry->file);
if (sector_remain && !read)
return -1;
}
/* Fill remainder with 00 bytes if needed. */