From 6a219b2481db3627f9815e7bff3f958ef6adbbc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 19:02:15 +0300 Subject: [PATCH] Fix #15006: Prevent allocating empty texture atlases --- src/openrct2-ui/drawing/engines/opengl/TextureCache.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h index 474092769a..416a4a2ddd 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h @@ -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++)