Merge pull request #46401 from kleonc/geometry2d_make_atlas_crash_fix

Geometry2D::make_atlas Fail is passed invalid rect size
This commit is contained in:
Rémi Verschelde 2021-02-25 07:18:39 +01:00 committed by GitHub
commit c0614bc059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());