1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-21 18:11:11 +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

@ -163,7 +163,7 @@ public:
OriginalSize = size;
Size = OriginalSize;
if (Size.Width == 0 || Size.Height == 0) {
if (core::min_(Size.Width, Size.Height) == 0 || core::max_(Size.Width, Size.Height) > Driver->MaxTextureSize) {
char buf[64];
snprintf_irr(buf, sizeof(buf), "%dx%d", Size.Width, Size.Height);
os::Printer::log("Invalid size for render target", buf, ELL_ERROR);