From 9f2b3efd13c513d06ad7a647766d6618d64deb82 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 11 Apr 2015 18:09:18 +0200 Subject: [PATCH] - fixed: The terrain types array needs to be extended if a texture outside its bounds is processed - this can happen for textures with long names. --- src/p_terrain.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_terrain.h b/src/p_terrain.h index 9f00d07bcd..482c66b00e 100644 --- a/src/p_terrain.h +++ b/src/p_terrain.h @@ -69,6 +69,12 @@ public: } void Set(int index, int value) { + if ((unsigned)index >= Types.Size()) + { + int oldsize = Types.Size(); + Resize(index + 1); + memset(&Types[oldsize], 0xff, (index + 1 - oldsize)*sizeof(WORD)); + } Types[index] = value; } };