1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Add more texture size limit checks

closes #16014
This commit is contained in:
sfan5 2025-08-11 15:29:58 +02:00
parent fd3588d49c
commit 6da927a548
3 changed files with 15 additions and 3 deletions

View file

@ -136,6 +136,14 @@ bool TextureBuffer::ensureTexture(video::ITexture **texture, const TextureDefini
return false;
}
const core::dimension2du max_size = m_driver->getMaxTextureSize();
if (size.Width > max_size.Width || size.Height > max_size.Height) {
errorstream << "Failed to create texture \"" << definition.name
<< "\": exceeds limit " << size.Width << "x" << size.Height
<< std::endl;
return false;
}
if (definition.clear) {
// We're not able to clear a render target texture
// We're not able to create a normal texture with MSAA