From 289c19d8c9342a3fe5b8869371634ee93809e83e Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Tue, 16 Sep 2014 12:48:52 +1000 Subject: [PATCH] fix gSessionTimesChart segfault --- sleepyhead/Graphs/gSessionTimesChart.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sleepyhead/Graphs/gSessionTimesChart.cpp b/sleepyhead/Graphs/gSessionTimesChart.cpp index 272161bf..91da9ab6 100644 --- a/sleepyhead/Graphs/gSessionTimesChart.cpp +++ b/sleepyhead/Graphs/gSessionTimesChart.cpp @@ -844,7 +844,8 @@ void gSessionTimesChart::paint(QPainter &painter, gGraph &graph, const QRegion & ///////////////////////////////////////////////////////////////////// peak_value = 0; min_value = 999; - for (int i=idx; i <= idx_end; ++i, ++it2) { + QMap::iterator it_end = dayindex.end(); + for (int i=idx; (i <= idx_end) && (it2 != it_end); ++i, ++it2) { Day * day = daylist.at(i); if (!day)