From 448295cd5183dc8cc168651aa69f5569538dce54 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 27 Jul 2021 12:26:13 +0800 Subject: Add check to internal methods to prevent crash --- scene/2d/tile_map.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'scene/2d') diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 3932f3dc78..e9efa1cf84 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -795,6 +795,7 @@ void TileMap::_set_tile_data(const Vector &p_data) { const int *r = p_data.ptr(); int offset = (format >= FORMAT_2) ? 3 : 2; + ERR_FAIL_COND_MSG(c % offset != 0, "Corrupted tile data."); clear(); -- cgit v1.2.3