mirror of https://github.com/PCSX2/pcsx2.git
DEV9: Fix off by one error on LBA range check
This commit is contained in:
parent
990d7ad0f7
commit
5d2bcfaa38
|
@ -396,7 +396,7 @@ bool ATA::HDD_CanAccess(int* sectors)
|
||||||
s64 posEnd;
|
s64 posEnd;
|
||||||
s64 maxLBA;
|
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
|
if ((regSelect & 0x40) == 0) //CHS mode
|
||||||
maxLBA = std::min<s64>(maxLBA, curCylinders * curHeads * curSectors);
|
maxLBA = std::min<s64>(maxLBA, curCylinders * curHeads * curSectors);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue