(svn r9890) -Codechange: Don't allocate space for 0 spriteset ranges

This commit is contained in:
peter1138 2007-05-20 16:17:03 +00:00
parent 45d1c92030
commit d20e06f9b6

View File

@ -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;