diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index a69413596..a53af6435 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -1623,7 +1623,12 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->sector_len -= dev->sector_pos; dev->sector_len++; + msf = 1; + + /* If all the flag bits are cleared, then treat it as a non-data command. */ + if (cdb[9] == 0x00) + dev->sector_len = 0; break; case GPCMD_READ_CD_OLD: case GPCMD_READ_CD: @@ -1632,6 +1637,10 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->sector_pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5]; msf = 0; + + /* If all the flag bits are cleared, then treat it as a non-data command. */ + if (cdb[9] == 0x00) + dev->sector_len = 0; break; }