DEV9: Fix off by one error on LBA range check

This commit is contained in:
TheLastRar authored and lightningterror committed 2022-02-28 09:44:14 +01:00
1 parent 990d7ad0f7
commit 5d2bcfaa38
1 file changed
+1 -1
+1 -1
View File
@@ -396,7 +396,7 @@ bool ATA::HDD_CanAccess(int* sectors)
s64 posEnd;
s64 maxLBA;
maxLBA = std::min<s64>((s64)config.HddSize * 1024 * 1024 / 512, hddImageSize);
maxLBA = std::min<s64>((s64)config.HddSize * 1024 * 1024 / 512, hddImageSize) - 1;
if ((regSelect & 0x40) == 0) //CHS mode
maxLBA = std::min<s64>(maxLBA, curCylinders * curHeads * curSectors);