From 0cbb08ce845c5ad431c264e5b8be5907204882fb Mon Sep 17 00:00:00 2001 From: drfrag Date: Sat, 14 Sep 2019 14:40:18 +0200 Subject: [PATCH] - Fixed crash with mock2.wad in software. --- src/rendering/swrenderer/textures/r_swtexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/swrenderer/textures/r_swtexture.cpp b/src/rendering/swrenderer/textures/r_swtexture.cpp index 89f6f3bda..bc502dabf 100644 --- a/src/rendering/swrenderer/textures/r_swtexture.cpp +++ b/src/rendering/swrenderer/textures/r_swtexture.cpp @@ -68,7 +68,7 @@ FSoftwareTexture::FSoftwareTexture(FTexture *tex) auto info = tex->CreateTexBuffer(0, CTF_CheckOnly| mBufferFlags); mPhysicalWidth = info.mWidth; mPhysicalHeight = info.mHeight; - mPhysicalScale = mPhysicalWidth / tex->Width; + mPhysicalScale = tex->Width > 0? mPhysicalWidth / tex->Width : mPhysicalWidth; CalcBitSize(); }