Commit 25d38506 authored by Brad King's avatar Brad King
Browse files

BUG: SetupPieces should not allocate a zero-size array when there are no pieces.

parent c65ad6b0
......@@ -22,7 +22,7 @@
#include "vtkXMLDataElement.h"
#include "vtkXMLDataParser.h"
vtkCxxRevisionMacro(vtkXMLDataReader, "1.8");
vtkCxxRevisionMacro(vtkXMLDataReader, "1.9");
//----------------------------------------------------------------------------
vtkXMLDataReader::vtkXMLDataReader()
......@@ -117,8 +117,11 @@ void vtkXMLDataReader::SetupPieces(int numPieces)
{
if(this->NumberOfPieces) { this->DestroyPieces(); }
this->NumberOfPieces = numPieces;
this->PointDataElements = new vtkXMLDataElement*[numPieces];
this->CellDataElements = new vtkXMLDataElement*[numPieces];
if(numPieces > 0)
{
this->PointDataElements = new vtkXMLDataElement*[numPieces];
this->CellDataElements = new vtkXMLDataElement*[numPieces];
}
int i;
for(i=0;i < this->NumberOfPieces;++i)
{
......
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