]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Remove last track being larger than total tracks check. It is allowed by SCSI spec.
authorToni Wilen <twilen@winuae.net>
Sat, 21 Sep 2024 17:21:48 +0000 (20:21 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 21 Sep 2024 17:21:48 +0000 (20:21 +0300)
blkdev.cpp

index 19608d7d4146d4e4aae2018376246cdb06e23569..92a60a80f8840d9777723f50742331a3e4cb2130 100644 (file)
@@ -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;