From: Toni Wilen Date: Sat, 21 Sep 2024 17:21:48 +0000 (+0300) Subject: Remove last track being larger than total tracks check. It is allowed by SCSI spec. X-Git-Tag: 5310~11 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=7e48f75a18654a55e5b001665eed8c4f52e9e162;p=francis%2Fwinuae.git Remove last track being larger than total tracks check. It is allowed by SCSI spec. --- diff --git a/blkdev.cpp b/blkdev.cpp index 19608d7d..92a60a80 100644 --- a/blkdev.cpp +++ b/blkdev.cpp @@ -1982,11 +1982,10 @@ int scsi_cd_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len, goto readerr; struct cd_toc_head *toc = &ttoc; if (strack < toc->first_track || strack > toc->last_track || - etrack < toc->first_track || etrack > toc->last_track || - strack > etrack) + etrack < toc->first_track || strack > etrack) goto errreq; int start = toc->toc[toc->first_track_offset + strack - 1].paddress; - int end = etrack == toc->last_track ? toc->lastaddress : toc->toc[toc->first_track_offset + etrack - 1 + 1].paddress; + int end = etrack >= toc->last_track ? toc->lastaddress : toc->toc[toc->first_track_offset + etrack - 1 + 1].paddress; sys_command_cd_pause (unitnum, 0); if (!sys_command_cd_play (unitnum, start, end, 0)) goto wrongtracktype;