CD-ROM: Actually set the format variable of GPCMD_READ_DVD_STRUCTURE to cdb[7], fixes heap corruptions due to the format incorrectly mismatching the given buffer lengths, fixes #4522 .

This commit is contained in:
OBattler
2024-06-13 19:21:37 +02:00
parent fb267d1f8b
commit e5f676d9b5

View File

@@ -3000,6 +3000,7 @@ begin:
if ((cdb[7] <= 0x7f) || (cdb[7] == 0xff)) {
if (cdb[1] == 0) {
format = cdb[7];
ret = scsi_cdrom_read_dvd_structure(dev, format, cdb, dev->buffer);
dev->buffer[0] = (ret >> 8);
dev->buffer[1] = (ret & 0xff);