From 5d2bcfaa389404f4e2037933f141eb29451d4505 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sun, 6 Feb 2022 16:32:19 +0000 Subject: [PATCH] DEV9: Fix off by one error on LBA range check --- pcsx2/DEV9/ATA/ATA_State.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/DEV9/ATA/ATA_State.cpp b/pcsx2/DEV9/ATA/ATA_State.cpp index 342fe13605..306388a05d 100644 --- a/pcsx2/DEV9/ATA/ATA_State.cpp +++ b/pcsx2/DEV9/ATA/ATA_State.cpp @@ -396,7 +396,7 @@ bool ATA::HDD_CanAccess(int* sectors) s64 posEnd; s64 maxLBA; - maxLBA = std::min((s64)config.HddSize * 1024 * 1024 / 512, hddImageSize); + maxLBA = std::min((s64)config.HddSize * 1024 * 1024 / 512, hddImageSize) - 1; if ((regSelect & 0x40) == 0) //CHS mode maxLBA = std::min(maxLBA, curCylinders * curHeads * curSectors);