From 02133a02904092c33fbab664d33bf7388805e4c2 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Tue, 4 Jul 2023 10:32:38 +0100 Subject: [PATCH] GS/HW: Missed a Div 0 in previous push. --- pcsx2/GS/GSLocalMemory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcsx2/GS/GSLocalMemory.cpp b/pcsx2/GS/GSLocalMemory.cpp index 8bad999c77..905913ba75 100644 --- a/pcsx2/GS/GSLocalMemory.cpp +++ b/pcsx2/GS/GSLocalMemory.cpp @@ -491,7 +491,8 @@ GSVector4i GSLocalMemory::GetRectForPageOffset(u32 base_bp, u32 offset_bp, u32 b const u32 page_offset = (offset_bp - base_bp) >> 5; const GSVector2i& pgs = m_psm[psm].pgs; - const GSVector2i page_offset_xy = GSVector2i(page_offset % bw, page_offset / std::max(1U, bw)); + const u32 valid_bw = std::max(1U, bw); + const GSVector2i page_offset_xy = GSVector2i(page_offset % valid_bw, page_offset / std::max(1U, valid_bw)); return GSVector4i(pgs * page_offset_xy).xyxy() + GSVector4i::loadh(pgs); }