diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-12-11 08:41:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 08:41:29 +0100 |
commit | 30cf60bb89fd89199308c66c5a769d5ea7557452 (patch) | |
tree | 505d6728a87874e735afe6d10df0c12ed9a49242 /scene/resources/texture.cpp | |
parent | ea865d0e7ee6fb3f605406355bed1d975d84dca8 (diff) | |
parent | 5586103a9475893bb1a2bcb4ebf7f5005544253f (diff) |
Merge pull request #34259 from timothyqiu/validate-texture-32982
Fixes crash after set_piece_texture with invalid texture
Diffstat (limited to 'scene/resources/texture.cpp')
-rw-r--r-- | scene/resources/texture.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 593c399f62..b21546af2f 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -1333,6 +1333,7 @@ void LargeTexture::set_piece_offset(int p_idx, const Point2 &p_offset) { void LargeTexture::set_piece_texture(int p_idx, const Ref<Texture> &p_texture) { ERR_FAIL_COND(p_texture == this); + ERR_FAIL_COND(p_texture.is_null()); ERR_FAIL_INDEX(p_idx, pieces.size()); pieces.write[p_idx].texture = p_texture; }; |