From 426730bf9196f92bcb5f317abb8d082e3a6bbba3 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Wed, 1 Jun 2022 23:31:50 +0200 Subject: [PATCH] Don't crash attempting to scale zero-sized images fixes minetest/minetest#12393 --- source/Irrlicht/CImage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Irrlicht/CImage.cpp b/source/Irrlicht/CImage.cpp index 1f893090..18fc92bd 100644 --- a/source/Irrlicht/CImage.cpp +++ b/source/Irrlicht/CImage.cpp @@ -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;