Don't crash attempting to scale zero-sized images

fixes minetest/minetest#12393
This commit is contained in:
sfan5 2022-06-01 23:31:50 +02:00
parent aa095d9525
commit 426730bf91

@ -183,7 +183,7 @@ void CImage::copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT fo
return;
}
if (!target || !width || !height)
if (!target || !width || !height || !Size.Width || !Size.Height)
return;
const u32 bpp=getBitsPerPixelFromFormat(format)/8;