diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-25 07:18:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-25 07:18:39 +0100 |
commit | c0614bc059788813aa037398227b2bd215495182 (patch) | |
tree | c484773da9ab63454d3e4f1a83e71de3f7a5d3f0 | |
parent | 757c151219cccc197cb5ff80dbbdf3e4a9b46e0d (diff) | |
parent | 988f4cdc90f9e6bf2ea960aa48e6b6e7e8faa7ee (diff) |
Merge pull request #46401 from kleonc/geometry2d_make_atlas_crash_fix
Geometry2D::make_atlas Fail is passed invalid rect size
-rw-r--r-- | core/math/geometry_2d.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/geometry_2d.cpp b/core/math/geometry_2d.cpp index 783750b9e6..d67be14d33 100644 --- a/core/math/geometry_2d.cpp +++ b/core/math/geometry_2d.cpp @@ -94,6 +94,10 @@ void Geometry2D::make_atlas(const Vector<Size2i> &p_rects, Vector<Point2i> &r_re // 256x8192 atlas (won't work anywhere). ERR_FAIL_COND(p_rects.size() == 0); + for (int i = 0; i < p_rects.size(); i++) { + ERR_FAIL_COND(p_rects[i].width <= 0); + ERR_FAIL_COND(p_rects[i].height <= 0); + } Vector<_AtlasWorkRect> wrects; wrects.resize(p_rects.size()); |