diff options
author | peter1138 <peter1138@openttd.org> | 2007-05-20 16:17:03 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-05-20 16:17:03 +0000 |
commit | f1c0229b5dcca85713bbb1aa5e4a7b2dddccfd61 (patch) | |
tree | 4712bad38134e813bff5059c7d33b4afad569999 | |
parent | 546dfc2758ab3e9896cca1646980f81582b6e556 (diff) | |
download | openttd-f1c0229b5dcca85713bbb1aa5e4a7b2dddccfd61.tar.xz |
(svn r9890) -Codechange: Don't allocate space for 0 spriteset ranges
-rw-r--r-- | src/newgrf.cpp | 2 |
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; |