Salome HOME
IPAL54097: SIGSEGV in Scalar Bar Properties dialog and crash in next operation
authoreap <eap@opencascade.com>
Mon, 24 Apr 2017 14:17:28 +0000 (17:17 +0300)
committerrnv <rnv@opencascade.com>
Mon, 24 Apr 2017 15:31:54 +0000 (18:31 +0300)
src/OBJECT/SMESH_ScalarBarActor.cxx

index 1f5b00b63a5ee13e16f5c72587cd3addce35024e..a45696d7e9a4e6059276eb03d76a41930f92f374 100644 (file)
@@ -578,15 +578,18 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       
       // rnv begin
       // Customization of the vtkScalarBarActor to show distribution histogram.
       
       // rnv begin
       // Customization of the vtkScalarBarActor to show distribution histogram.
-      if(myDistributionColoringType == SMESH_MULTICOLOR_TYPE && GetDistributionVisibility() && distrVisibility)
-        {
-          rgb = distColors->GetPointer(3*dcCount); //write into array directly
-          rgb[0] = rgba[0];
-          rgb[1] = rgba[1];
-          rgb[2] = rgba[2];
-          dcCount++;
-        }
+      if ( myDistributionColoringType == SMESH_MULTICOLOR_TYPE &&
+           GetDistributionVisibility() &&
+           distrVisibility &&
+           myNbValues[i] > 0 )
+      {
+        rgb = distColors->GetPointer(3*dcCount); //write into array directly
+        rgb[0] = rgba[0];
+        rgb[1] = rgba[1];
+        rgb[2] = rgba[2];
+        dcCount++;
       }
       }
+    }
 
     // Now position everything properly
     //
 
     // Now position everything properly
     //