From f1c0229b5dcca85713bbb1aa5e4a7b2dddccfd61 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 20 May 2007 16:17:03 +0000 Subject: (svn r9890) -Codechange: Don't allocate space for 0 spriteset ranges --- src/newgrf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(group->g.determ.num_ranges); + if (group->g.determ.num_ranges > 0) group->g.determ.ranges = CallocT(group->g.determ.num_ranges); if (!check_length(bufend - buf, 2 + (2 + 2 * varsize) * group->g.determ.num_ranges, "NewSpriteGroup (Deterministic)")) return; -- cgit v1.2.3-70-g09d2