From 50ff3649b1591b8f99dc3b76f34ff6f0cecdca80 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sun, 12 Feb 2023 19:14:54 +0000 Subject: [PATCH] GS: Fix divide by zero error --- pcsx2/GS/GSState.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/GS/GSState.h b/pcsx2/GS/GSState.h index cf89d346dd..e16401c807 100644 --- a/pcsx2/GS/GSState.h +++ b/pcsx2/GS/GSState.h @@ -516,7 +516,7 @@ public: } // Cap the framebuffer read to the maximum display height, otherwise the hardware renderer gets messy. - int min_mag = std::min(PCRTCDisplays[0].magnification.y, PCRTCDisplays[1].magnification.y); + int min_mag = std::max(1, std::min(PCRTCDisplays[0].magnification.y, PCRTCDisplays[1].magnification.y)); combined_rect.w = std::min(combined_rect.w, combined_rect.y + (max_height / min_mag)); return GSVector2i(combined_rect.z, combined_rect.w); }