Fix buffer overrun when rendering goto() debug texture, closes #841

dev-buzzingcars
krzys-h 2016-11-11 17:26:37 +01:00
parent 856ee9a0fe
commit 3bac0aabd9
1 changed files with 3 additions and 0 deletions

View File

@ -4404,6 +4404,9 @@ void CEngine::UpdateGroundSpotTextures()
{
int px = x / 4.0f / 254.0f * size.x;
int py = y / 4.0f / 254.0f * size.y;
// This can happen because the shadow??.png textures have a 1 pixel margin around them
if (px < 0 || px >= size.x || py < 0 || py >= size.y)
continue;
shadowImg.SetPixelInt(Math::IntPoint(x-min.x, y-min.y), m_displayGotoImage->GetPixelInt(Math::IntPoint(px, py)));
}
}