From: kgv Date: Tue, 5 Apr 2022 22:26:00 +0000 (+0300) Subject: 0032912: Visualization - crash when displaying an OBJ file with missing texture file X-Git-Tag: V7_7_0_beta~137 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=5078d0d84e453836e006d7ffdfe23f29af09d266;p=occt.git 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. --- diff --git a/src/Graphic3d/Graphic3d_TextureRoot.cxx b/src/Graphic3d/Graphic3d_TextureRoot.cxx index 027a5ebe4e..3595871c03 100644 --- a/src/Graphic3d/Graphic3d_TextureRoot.cxx +++ b/src/Graphic3d/Graphic3d_TextureRoot.cxx @@ -216,9 +216,9 @@ Handle(Image_PixMap) Graphic3d_TextureRoot::GetImage (const Handle(Image_Support void Graphic3d_TextureRoot::convertToCompatible (const Handle(Image_SupportedFormats)& theSupported, const Handle(Image_PixMap)& theImage) { - if (theSupported.IsNull() - || theSupported->IsSupported (theImage->Format()) - || theImage.IsNull()) + if (theImage.IsNull() + || theSupported.IsNull() + || theSupported->IsSupported (theImage->Format())) { return; }