mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-02 09:40:35 +00:00
(svn r9890) -Codechange: Don't allocate space for 0 spriteset ranges
This commit is contained in:
parent
45d1c92030
commit
d20e06f9b6
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user