From 4b89c095e209ec9b88c349f7629f99b54d572971 Mon Sep 17 00:00:00 2001 From: pogokeen Date: Wed, 10 Oct 2018 21:04:42 +0000 Subject: [PATCH] engine.cpp: fix crash when calling `setrendermode 3` where PolymostProcessVoxels would be called before Polymost is initialized. PolymostProcessVoxels would call videoNextPage during processing which would attempt to render the OSD and lead to a segfault due to Polymost not being properly initialized. git-svn-id: https://svn.eduke32.com/eduke32@7067 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/engine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 3fcd6d2ed..25c780059 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -9954,13 +9954,13 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups if (searchx < 0) { searchx = halfxdimen; searchy = (ydimen>>1); } #ifdef USE_OPENGL - if (videoGetRenderMode() == REND_POLYMOST) - PolymostProcessVoxels(); - if (videoGetRenderMode() >= REND_POLYMOST) { polymost_glreset(); polymost_glinit(); + + if (videoGetRenderMode() == REND_POLYMOST) + PolymostProcessVoxels(); } # ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER)