Commit ce0618c2 authored by Sean McBride's avatar Sean McBride

Fixed null dereference

If the big for loop is never entered,
then slice1scalars would be null and dereferenced

Change-Id: I4c8300c0b082c9f1a8349659f83297f81efa9894
parent 1fa832c3
......@@ -138,7 +138,7 @@ int vtkSliceCubesContour(T *slice, S *scalars, int imageRange[2], int dims[3],
double xmin[3], double xmax[3], FILE *outFP,
vtkVolumeReader *reader, unsigned char debug)
{
S *slice0scalars=NULL, *slice1scalars;
S *slice0scalars=NULL, *slice1scalars=NULL;
S *slice2scalars, *slice3scalars;
T *slice0, *slice1, *slice2, *slice3;
vtkImageData *sp;
......@@ -166,7 +166,6 @@ int vtkSliceCubesContour(T *slice, S *scalars, int imageRange[2], int dims[3],
doubleScalars->Allocate(sliceSize);
}
slice1scalars = NULL;
slice2scalars = scalars;
slice2scalars->Register(NULL);
......@@ -387,7 +386,10 @@ int vtkSliceCubesContour(T *slice, S *scalars, int imageRange[2], int dims[3],
{
slice3scalars->Delete();
}
slice1scalars->Delete();
if (slice1scalars)
{
slice1scalars->Delete();
}
slice2scalars->Delete();
return numTriangles;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment