From 19e8774ad06a194a1d446ad4d41b0407782327b6 Mon Sep 17 00:00:00 2001 From: Jaklyy <102590697+Jaklyy@users.noreply.github.com> Date: Fri, 10 May 2024 05:44:51 -0400 Subject: [PATCH] fix crash under freak circumstances --- src/GPU3D_Soft.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GPU3D_Soft.h b/src/GPU3D_Soft.h index a4342431..4783dff3 100644 --- a/src/GPU3D_Soft.h +++ b/src/GPU3D_Soft.h @@ -145,7 +145,7 @@ private: constexpr s32 Interpolate(s32 y0, s32 y1) const { - if (x == 0 || y0 == y1) return y0; + if (x == 0 || xdiff == 0 || y0 == y1) return y0; if (!linear) { @@ -167,7 +167,7 @@ private: constexpr s32 InterpolateZ(s32 z0, s32 z1) { - if (x == 0 || z0 == z1) return z0; + if (x == 0 || xdiff == 0 || z0 == z1) return z0; if (wbuffer) {