Fix #15006: Prevent allocating empty texture atlases

This commit is contained in:
ζeh Matt 2021-10-20 19:02:15 +03:00
parent 2d78a5efc3
commit 6a219b2481
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 2 additions and 2 deletions

View File

@ -101,8 +101,8 @@ public:
_atlasWidth = atlasWidth;
_atlasHeight = atlasHeight;
_cols = _atlasWidth / _imageSize;
_rows = _atlasHeight / _imageSize;
_cols = std::max(1, _atlasWidth / _imageSize);
_rows = std::max(1, _atlasHeight / _imageSize);
_freeSlots.resize(_cols * _rows);
for (size_t i = 0; i < _freeSlots.size(); i++)