From 325af156e71124fbc346f5d7172898d9c4cf5fa1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 8 May 2021 09:16:06 +0200 Subject: [PATCH] - fixed loop in ProcessBunch to account for array reallocation. --- source/core/rendering/scene/hw_bunchdrawer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/core/rendering/scene/hw_bunchdrawer.cpp b/source/core/rendering/scene/hw_bunchdrawer.cpp index 50ef2995a..b81b9c0ef 100644 --- a/source/core/rendering/scene/hw_bunchdrawer.cpp +++ b/source/core/rendering/scene/hw_bunchdrawer.cpp @@ -275,10 +275,13 @@ int BunchDrawer::ClipLine(int aline, bool portal) void BunchDrawer::ProcessBunch(int bnch) { FBunch* bunch = &Bunches[bnch]; + int start = bunch->startline; + int end = bunch->endline; ClipWall.Clock(); - for (int i = bunch->startline; i <= bunch->endline; i++) + for (int i = start; i <= end; i++) { + bunch = &Bunches[bnch]; // re-get the pointer in case of reallocation. int clipped = ClipLine(i, bunch->portal); if (clipped & CL_Draw)