diff --git a/pcsx2/GS/GSLocalMemory.cpp b/pcsx2/GS/GSLocalMemory.cpp index c16c796ead..8bad999c77 100644 --- a/pcsx2/GS/GSLocalMemory.cpp +++ b/pcsx2/GS/GSLocalMemory.cpp @@ -491,7 +491,7 @@ 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 / bw); + const GSVector2i page_offset_xy = GSVector2i(page_offset % bw, page_offset / std::max(1U, bw)); return GSVector4i(pgs * page_offset_xy).xyxy() + GSVector4i::loadh(pgs); } diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 176d0a7307..4421da9253 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -914,7 +914,7 @@ GSVector4i GSRendererHW::GetSplitTextureShuffleDrawRect() const GSVector4i GSRendererHW::GetDrawRectForPages(u32 bw, u32 psm, u32 num_pages) { const GSVector2i& pgs = GSLocalMemory::m_psm[psm].pgs; - const GSVector2i size = GSVector2i(static_cast(bw) * pgs.x, static_cast(num_pages / bw) * pgs.y); + const GSVector2i size = GSVector2i(static_cast(bw) * pgs.x, static_cast(num_pages / std::max(1U, bw)) * pgs.y); return GSVector4i::loadh(size); }