From bca1d6e249ad363cef341fff8409f50a38978463 Mon Sep 17 00:00:00 2001 From: kgv Date: Tue, 11 Dec 2012 17:57:50 +0400 Subject: [PATCH] 0023630: Incorrect NULL check in OpenGl_Workspace::EnableTexture() --- src/OpenGl/OpenGl_Workspace.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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();