]> OCCT Git - occt-copy.git/commitdiff
0023630: Incorrect NULL check in OpenGl_Workspace::EnableTexture()
authorkgv <kgv@opencascade.com>
Tue, 11 Dec 2012 13:57:50 +0000 (17:57 +0400)
committerkgv <kgv@opencascade.com>
Fri, 14 Dec 2012 12:44:24 +0000 (16:44 +0400)
src/OpenGl/OpenGl_Workspace.cxx

index 1628334a645b7d8a06fdf316d78d85e1cf5dcd31..3f1bd8191eb06257f2eb17ecec23af3cdac35437 100644 (file)
@@ -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();