Fix buffer overrun when rendering goto() debug texture, closes #841
parent
856ee9a0fe
commit
3bac0aabd9
|
@ -4404,6 +4404,9 @@ void CEngine::UpdateGroundSpotTextures()
|
||||||
{
|
{
|
||||||
int px = x / 4.0f / 254.0f * size.x;
|
int px = x / 4.0f / 254.0f * size.x;
|
||||||
int py = y / 4.0f / 254.0f * size.y;
|
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)));
|
shadowImg.SetPixelInt(Math::IntPoint(x-min.x, y-min.y), m_displayGotoImage->GetPixelInt(Math::IntPoint(px, py)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue