Add check to internal methods to prevent crash

(cherry picked from commit 448295cd51)
This commit is contained in:
Haoyu Qiu 2021-07-27 12:26:13 +08:00 committed by Rémi Verschelde
parent 9fd201c7a4
commit eb31a39e82
No account linked to committer's email address
2 changed files with 2 additions and 0 deletions

View file

@ -1177,6 +1177,7 @@ void TileMap::_set_tile_data(const PoolVector<int> &p_data) {
PoolVector<int>::Read r = p_data.read(); PoolVector<int>::Read r = p_data.read();
int offset = (format == FORMAT_2) ? 3 : 2; int offset = (format == FORMAT_2) ? 3 : 2;
ERR_FAIL_COND_MSG(c % offset != 0, "Corrupted tile data.");
clear(); clear();
for (int i = 0; i < c; i += offset) { for (int i = 0; i < c; i += offset) {

View file

@ -128,6 +128,7 @@ void ProximityGroup::broadcast(String p_method, Variant p_parameters) {
void ProximityGroup::_proximity_group_broadcast(String p_method, Variant p_parameters) { void ProximityGroup::_proximity_group_broadcast(String p_method, Variant p_parameters) {
if (dispatch_mode == MODE_PROXY) { if (dispatch_mode == MODE_PROXY) {
ERR_FAIL_COND(!is_inside_tree());
get_parent()->call(p_method, p_parameters); get_parent()->call(p_method, p_parameters);
} else { } else {
emit_signal("broadcast", p_method, p_parameters); emit_signal("broadcast", p_method, p_parameters);