Fix #10015: Crash when certain images are drawn (#10016)

This commit is contained in:
ζeh Matt authored and Michael Steenbeek committed 2019-09-23 22:37:28 +02:00
1 parent b2a42de579
commit b82d1bbc64
1 file changed
+2 -6
+2 -6
View File
@@ -510,7 +510,7 @@ void FASTCALL gfx_bmp_sprite_to_buffer(
uint8_t* FASTCALL gfx_draw_sprite_get_palette(ImageId imageId)
{
if (imageId.IsRemap())
if (!imageId.HasSecondary())
{
uint8_t palette_ref = imageId.GetRemap();
if (!imageId.IsBlended())
@@ -529,7 +529,7 @@ uint8_t* FASTCALL gfx_draw_sprite_get_palette(ImageId imageId)
return g1->offset;
}
}
else if (imageId.HasSecondary())
else
{
uint8_t* palette_pointer = gPeepPalette;
@@ -562,10 +562,6 @@ uint8_t* FASTCALL gfx_draw_sprite_get_palette(ImageId imageId)
return palette_pointer;
}
else
{
return nullptr;
}
}
void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, ImageId imageId, int32_t x, int32_t y)