From 5a090e84bc5f575e91f65f627fd50da1e536ba78 Mon Sep 17 00:00:00 2001 From: plagman Date: Sun, 26 Apr 2009 17:47:08 +0000 Subject: [PATCH] Couple of fixes for corrupt maps. git-svn-id: https://svn.eduke32.com/eduke32@1347 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 7fe96c29e..54a0decbf 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -2082,6 +2082,8 @@ static void polymer_updatewall(int16_t wallnum) wal = &wall[wallnum]; nwallnum = wal->nextwall; sec = §or[sectorofwall(wallnum)]; + if (sec->wallptr > wallnum) + return; // the map is horribly corrupt w = prwalls[wallnum]; s = prsectors[sectorofwall(wallnum)]; invalid = s->invalidid; @@ -2639,7 +2641,7 @@ static void polymer_computeplane(_prplane* p) } i+= 1; } - while (i < p->indicescount); + while ((i + 2) < p->indicescount); } static inline void polymer_crossproduct(GLfloat* in_a, GLfloat* in_b, GLfloat* out)