Commit 95e411e3 authored by loring's avatar loring

time iterator expression memory bug

fix out-of-bounds index into cycles/times arrays (in execute method)
by clamping to the last available cycle/time.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23760 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7c85d849
......@@ -469,6 +469,11 @@ avtTimeIteratorExpression::ConstructContractWithVarnames(void)
// Programmer: Hank Childs
// Creation: February 14, 2009
//
// Modifications:
// Burlen Loring, Mon Jul 14 15:31:15 PDT 2014
// fix out-of-bounds index into cycles/times arrays (in execute method)
// by clamping to the last available cycle/time.
//
// ****************************************************************************
void
......@@ -494,21 +499,19 @@ avtTimeIteratorExpression::FinalizeTimeLoop()
msg += ".\n";
EXCEPTION1(ImproperUseException, msg);
}
numTimeSlicesToProcess = (lastTimeSlice-firstTimeSlice)/timeStride+1;
if (lastTimeSlice >= numStates)
{
std::string msg(GetType());
msg += ": Clamping end time to number of available timesteps.";
avtCallback::IssueWarning(msg.c_str());
lastTimeSlice = numStates - 1;
}
//
numTimeSlicesToProcess = (lastTimeSlice-firstTimeSlice)/timeStride+1;
actualLastTimeSlice = firstTimeSlice + (numTimeSlicesToProcess-1)*timeStride;
// Ensure that the specified lastTimeSlice is included,
// regardless of the timeStride.
//
actualLastTimeSlice = firstTimeSlice + (numTimeSlicesToProcess-1)*timeStride;
if (actualLastTimeSlice < lastTimeSlice)
{
numTimeSlicesToProcess++;
......
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