Fix getCanvasTileAreaPoly ArrayOutOfBounds
Safe-check tile settings size to prevent array out of bounds exception. Fixes #4579 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -328,6 +328,11 @@ public class Perspective
|
|||||||
final int sceneX = localLocation.getSceneX();
|
final int sceneX = localLocation.getSceneX();
|
||||||
final int sceneY = localLocation.getSceneY();
|
final int sceneY = localLocation.getSceneY();
|
||||||
|
|
||||||
|
if (sceneX < 0 || sceneY < 0 || sceneX >= SCENE_SIZE || sceneY >= SCENE_SIZE)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
int tilePlane = plane;
|
int tilePlane = plane;
|
||||||
if (plane < Constants.MAX_Z - 1 && (tileSettings[1][sceneX][sceneY] & TILE_FLAG_BRIDGE) == TILE_FLAG_BRIDGE)
|
if (plane < Constants.MAX_Z - 1 && (tileSettings[1][sceneX][sceneY] & TILE_FLAG_BRIDGE) == TILE_FLAG_BRIDGE)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user