mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-11-16 03:00:36 +01:00
DEV9: Fix off by one error on LBA range check
This commit is contained in:
1 parent
990d7ad0f7
commit
5d2bcfaa38
1 file changed
+1
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user