0023917: Primitive Array with reserved but unused Edges array drawn corrupted from VBO
authorkgv <kgv@opencascade.com>
Fri, 19 Apr 2013 12:33:05 +0000 (16:33 +0400)
committerkgv <kgv@opencascade.com>
Thu, 16 May 2013 07:04:05 +0000 (11:04 +0400)
src/OpenGl/OpenGl_PrimitiveArray.cxx

index 8e71c6a..02a14a6 100755 (executable)
@@ -85,7 +85,8 @@ Standard_Boolean OpenGl_PrimitiveArray::BuildVBO (const Handle(OpenGl_Workspace)
     return Standard_False;
   }
 
-  if (myPArray->edges != NULL)
+  if (myPArray->edges != NULL
+   && myPArray->num_edges > 0)
   {
     myVbos[VBOEdges] = new OpenGl_IndexBuffer();
     if (!myVbos[VBOEdges]->Init (aGlCtx, 1, myPArray->num_edges, (GLuint* )myPArray->edges))