From 4739dfef9bf76449bebba893f6b3737f6c58477e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 28 Jul 2012 12:40:36 +0200 Subject: [PATCH] Fixed: A strange loading crash with bad textures --- .../nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp index b50709cd2..2cd16bf1c 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -868,6 +868,13 @@ bool CDriverD3D::uploadTextureInternal (ITexture& tex, CRect& rect, uint8 destMi D3DFORMAT destFormat, D3DFORMAT srcFormat) { H_AUTO_D3D(CDriverD3D_uploadTextureInternal) + + if (rect.Width == 0 || rect.Height == 0) + { + nlwarning("Rectangle width or height cannot be 0"); + return false; + } + // The D3D texture CTextureDrvInfosD3D* d3dtext = getTextureD3D(tex);