summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-05-20 16:17:03 +0000
committerpeter1138 <peter1138@openttd.org>2007-05-20 16:17:03 +0000
commitd20e06f9b6fe175184bd5aa4d7807faa4ce7aa92 (patch)
tree4712bad38134e813bff5059c7d33b4afad569999
parent45d1c9203048d998041426970911fa214079ae55 (diff)
downloadopenttd-d20e06f9b6fe175184bd5aa4d7807faa4ce7aa92.tar.xz
(svn r9890) -Codechange: Don't allocate space for 0 spriteset ranges
-rw-r--r--src/newgrf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 55f64f461..afa656ab8 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2208,7 +2208,7 @@ static void NewSpriteGroup(byte *buf, int len)
} while (HASBIT(varadjust, 5));
group->g.determ.num_ranges = grf_load_byte(&buf);
- group->g.determ.ranges = CallocT<DeterministicSpriteGroupRange>(group->g.determ.num_ranges);
+ if (group->g.determ.num_ranges > 0) group->g.determ.ranges = CallocT<DeterministicSpriteGroupRange>(group->g.determ.num_ranges);
if (!check_length(bufend - buf, 2 + (2 + 2 * varsize) * group->g.determ.num_ranges, "NewSpriteGroup (Deterministic)")) return;