From 31d8a230465603da226f9a77e6b28ef050559594 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 12 Nov 2022 08:59:41 +0100 Subject: [PATCH] - avoid infinite portal recursion. --- src/rendering/hwrenderer/scene/hw_portal.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rendering/hwrenderer/scene/hw_portal.cpp b/src/rendering/hwrenderer/scene/hw_portal.cpp index b06d51c587d..aaf7ae06ce5 100644 --- a/src/rendering/hwrenderer/scene/hw_portal.cpp +++ b/src/rendering/hwrenderer/scene/hw_portal.cpp @@ -779,6 +779,11 @@ void HWSectorStackPortal::SetupCoverage(HWDrawInfo *di) bool HWSectorStackPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clipper) { auto state = mState; + if (state->renderdepth > 100) // energency abort in case a map manages to set up a recursion. + { + return false; + } + FSectorPortalGroup *portal = origin; auto &vp = di->Viewpoint;