GS: Fix undefined behaviour bug in PCRTC

This commit is contained in:
refractionpcsx2 2023-02-12 14:28:34 +00:00
parent fa70f0e764
commit 9ca9db8770
1 changed files with 2 additions and 1 deletions

View File

@ -516,7 +516,8 @@ public:
}
// Cap the framebuffer read to the maximum display height, otherwise the hardware renderer gets messy.
combined_rect.w = std::min(combined_rect.w, combined_rect.y + (max_height * PCRTCDisplays[display].magnification.y));
int min_mag = 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);
}
else