From: kgv Date: Tue, 11 Dec 2012 13:57:50 +0000 (+0400) Subject: 0023630: Incorrect NULL check in OpenGl_Workspace::EnableTexture() X-Git-Tag: V6_6_0_beta~170 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=bca1d6e249ad363cef341fff8409f50a38978463;p=occt-copy.git 0023630: Incorrect NULL check in OpenGl_Workspace::EnableTexture() --- diff --git a/src/OpenGl/OpenGl_Workspace.cxx b/src/OpenGl/OpenGl_Workspace.cxx index 1628334a64..3f1bd8191e 100644 --- a/src/OpenGl/OpenGl_Workspace.cxx +++ b/src/OpenGl/OpenGl_Workspace.cxx @@ -408,11 +408,11 @@ Handle(OpenGl_Texture) OpenGl_Workspace::EnableTexture (const Handle(OpenGl_Text return DisableTexture(); } - if (myTextureBound.IsNull() && myTextureBound == theTexture) + if (myTextureBound == theTexture + && (theParams.IsNull() || theParams == theTexture->GetParams())) { - Handle(OpenGl_Texture) aPrevTexture = myTextureBound; - myTextureBound = theTexture; - return aPrevTexture; + // already bound + return myTextureBound; } Handle(OpenGl_Texture) aPrevTexture = DisableTexture();