Commit d2f6c31c authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Fix invalid list access when nesting timeline events

We should check if the parent list is empty before accessing it, not
after.

Change-Id: Ia61887414b526b4414aa8a45d0c8779e020529e4
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 8d74fdd6
......@@ -127,6 +127,11 @@ void SortedTimelineModel::computeNesting()
for (int range = 0; range != count(); ++range) {
Range &current = ranges[range];
for (QLinkedList<int>::iterator parentIt = parents.begin();;) {
if (parentIt == parents.end()) {
parents.append(range);
break;
}
Range &parent = ranges[*parentIt];
qint64 parentEnd = parent.start + parent.duration;
if (parentEnd < current.start) {
......@@ -152,11 +157,6 @@ void SortedTimelineModel::computeNesting()
} else {
++parentIt;
}
if (parentIt == parents.end()) {
parents.append(range);
break;
}
}
}
}
......
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