mirror of https://github.com/OpenTTD/OpenTTD
(svn r12005) -Fix [FS#1717]: possible reading from an invalid pointer. Patch by PhilSophus.
parent
3b2145aafe
commit
c9a9103566
|
@ -262,8 +262,8 @@ bool LoadNextSprite(int load_index, byte file_slot, uint file_sprite_id)
|
||||||
|
|
||||||
void DupSprite(SpriteID old_spr, SpriteID new_spr)
|
void DupSprite(SpriteID old_spr, SpriteID new_spr)
|
||||||
{
|
{
|
||||||
|
SpriteCache *scnew = AllocateSpriteCache(new_spr); // may reallocate: so put it first
|
||||||
SpriteCache *scold = GetSpriteCache(old_spr);
|
SpriteCache *scold = GetSpriteCache(old_spr);
|
||||||
SpriteCache *scnew = AllocateSpriteCache(new_spr);
|
|
||||||
|
|
||||||
scnew->file_slot = scold->file_slot;
|
scnew->file_slot = scold->file_slot;
|
||||||
scnew->file_pos = scold->file_pos;
|
scnew->file_pos = scold->file_pos;
|
||||||
|
|
Loading…
Reference in New Issue