Commit d202c02c authored by Berk Geveci's avatar Berk Geveci
Browse files

BUG: Should not try to access memory when it is not allocated. When...

BUG: Should not try to access memory when it is not allocated. When NumberOfTimeSteps == 1, NumberOfTimeValues is null
parent 5b557af6
......@@ -42,7 +42,7 @@
# include <io.h> /* unlink */
#endif
vtkCxxRevisionMacro(vtkXMLWriter, "1.57");
vtkCxxRevisionMacro(vtkXMLWriter, "1.58");
vtkCxxSetObjectMacro(vtkXMLWriter, Compressor, vtkDataCompressor);
//----------------------------------------------------------------------------
......@@ -2602,11 +2602,14 @@ void vtkXMLWriter::WriteNextTime(double time)
ostream& os = *(this->Stream);
if (this->NumberOfTimeValues)
{
// Write user specified time value in the TimeValues attribute
unsigned long returnPos = os.tellp();
os.seekp(this->NumberOfTimeValues[this->CurrentTimeIndex-1]);
os << time;
os.seekp(returnPos);
}
}
Supports Markdown
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