diff options
author | kleonc <9283098+kleonc@users.noreply.github.com> | 2021-02-24 22:17:44 +0100 |
---|---|---|
committer | kleonc <9283098+kleonc@users.noreply.github.com> | 2021-02-24 23:38:30 +0100 |
commit | 988f4cdc90f9e6bf2ea960aa48e6b6e7e8faa7ee (patch) | |
tree | ad4c8798332b0613836006cb8b6a4293642d70fb /core | |
parent | 4cdd22212a9b1acbb62f0c82160f80c8aed2191e (diff) |
Geometry2D::make_atlas Fail is passed invalid rect size
Diffstat (limited to 'core')
-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()); |