From c004c09c9ebb3fa87e5c315ffb3151d6472156cf Mon Sep 17 00:00:00 2001 From: kgv Date: Wed, 6 Apr 2022 01:26:00 +0300 Subject: [PATCH] 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. --- src/Graphic3d/Graphic3d_TextureRoot.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Graphic3d/Graphic3d_TextureRoot.cxx b/src/Graphic3d/Graphic3d_TextureRoot.cxx index a89f32dabe..13f77134cf 100644 --- a/src/Graphic3d/Graphic3d_TextureRoot.cxx +++ b/src/Graphic3d/Graphic3d_TextureRoot.cxx @@ -214,9 +214,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; }