Commit 4fec9750 authored by Leander Schulten's avatar Leander Schulten

ProgramPrototype: Fix crash in getValueForTime(...) when the timeline has...

ProgramPrototype: Fix crash in getValueForTime(...) when the timeline has length x and you want to get the value for y%x == 0
parent 46eac62f
Pipeline #193495 passed with stage
in 5 minutes and 38 seconds
......@@ -57,6 +57,10 @@ unsigned char ChannelProgramm::getValueForTime(double t)const{
t = length - t;
}
}
// t must be smaller as length, otherwise timeline.upper_bound returns timeline.end()
if (t >= length) {
t = std::nextafter(length, 0);
}
// den rechten und linken Zeitpunkt bestimmen und interpolieren.
auto iter = timeline.upper_bound(t);
const auto rightValue = iter->value;
......
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