From 1fda9421ac1f310e61aaca76c5975722feef9960 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 14 Aug 2010 20:00:47 +0000 Subject: [PATCH] Backported from GZDoom: - Fixed: P_LoopSidedefs() needs to clean out sidetemp[] because when it's called a second time, the maximum of the number of vertices and that of sides may have increased compared to when P_AllocateSideDefs() created the array, which led to access violations. SVN r2541 (trunk) --- src/p_setup.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 636d4d69f..4ddb79e3c 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -2132,10 +2132,11 @@ static void P_LoopSidedefs () { int i; - if (sidetemp == NULL) + if (sidetemp != NULL) { - sidetemp = new sidei_t[MAX(numvertexes, numsides)]; + delete[] sidetemp; } + sidetemp = new sidei_t[MAX(numvertexes, numsides)]; for (i = 0; i < numvertexes; ++i) {