1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0032912: Visualization - crash when displaying an OBJ file with missing texture file

Fix NULL dereference within Graphic3d_TextureRoot::convertToCompatible() due to wrong order of checks.
This commit is contained in:
kgv 2022-04-06 01:26:00 +03:00 committed by smoskvin
parent ad3825f821
commit 5078d0d84e

View File

@ -216,9 +216,9 @@ Handle(Image_PixMap) Graphic3d_TextureRoot::GetImage (const Handle(Image_Support
void Graphic3d_TextureRoot::convertToCompatible (const Handle(Image_SupportedFormats)& theSupported, void Graphic3d_TextureRoot::convertToCompatible (const Handle(Image_SupportedFormats)& theSupported,
const Handle(Image_PixMap)& theImage) const Handle(Image_PixMap)& theImage)
{ {
if (theSupported.IsNull() if (theImage.IsNull()
|| theSupported->IsSupported (theImage->Format()) || theSupported.IsNull()
|| theImage.IsNull()) || theSupported->IsSupported (theImage->Format()))
{ {
return; return;
} }