From dabaf5528a0815dd8755c1f19b346e89dc5f83df Mon Sep 17 00:00:00 2001 From: rainlizard <15337628+rainlizard@users.noreply.github.com> Date: Mon, 8 Dec 2025 06:25:45 +1100 Subject: [PATCH 1/3] Revert "Potential 4k crash fix in trig_render_md10 (#4389)" This reverts commit 96fcaf724fafe304bbe1364b838da09654a61926. --- src/bflib_render_trig.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/bflib_render_trig.c b/src/bflib_render_trig.c index 319e1f7e6a..994c840182 100644 --- a/src/bflib_render_trig.c +++ b/src/bflib_render_trig.c @@ -3019,10 +3019,6 @@ void trig_render_md10(struct TrigLocalRend *tlr) ERRORLOG("global arrays not set: 0x%p 0x%p 0x%p", m, f, polygon_point); return; } - if (tlr->screen_buffer_ptr == NULL) { - ERRORLOG("screen buffer not set"); - return; - } texture_v_step_fixed = tlr->v_step << 16; for (; tlr->render_height; tlr->render_height--, polygon_point++) From 6bac8c42dbcbb07cf52cbfcdcfef4721ba37e294 Mon Sep 17 00:00:00 2001 From: Loobinex Date: Thu, 11 Dec 2025 11:59:02 +0100 Subject: [PATCH 2/3] Different fix from swars see https://github.com/swfans/syndwarsfx/commit/7bd774d4ade34a416a49adf873eaed36c855e745 --- src/bflib_render_trig.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/bflib_render_trig.c b/src/bflib_render_trig.c index 994c840182..753ab27e8c 100644 --- a/src/bflib_render_trig.c +++ b/src/bflib_render_trig.c @@ -3058,14 +3058,10 @@ void trig_render_md10(struct TrigLocalRend *tlr) else { ushort colL, colH; - unsigned char pY_overflow; if (point_y_a > vec_window_width) point_y_a = vec_window_width; - pY_overflow = __OFSUBS__(point_y_a, point_x_a); - point_y_a = point_y_a - point_x_a; - if ( (unsigned char)(((point_y_a & 0x8000u) != 0) ^ pY_overflow) | ((ushort)point_y_a == 0) ) - continue; + continue; o += point_x_a; factorA = __ROL4__(polygon_point->V, 16); colH = factorA; From adc37d3db5824572c478268f3884b12e80ce854f Mon Sep 17 00:00:00 2001 From: Loobinex Date: Fri, 16 Jan 2026 23:00:26 +0100 Subject: [PATCH 3/3] Added the rest of the fix --- src/bflib_render_trig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bflib_render_trig.c b/src/bflib_render_trig.c index 753ab27e8c..822cb759c3 100644 --- a/src/bflib_render_trig.c +++ b/src/bflib_render_trig.c @@ -3061,7 +3061,9 @@ void trig_render_md10(struct TrigLocalRend *tlr) if (point_y_a > vec_window_width) point_y_a = vec_window_width; - continue; + if (point_y_a <= point_x_a) + continue; + point_y_a -= point_x_a; o += point_x_a; factorA = __ROL4__(polygon_point->V, 16); colH = factorA;