diff options
author | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2015-12-18 19:24:35 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-03 12:33:06 +0000 |
commit | e813fe238121316ae04dc01c70432920bff1af92 (patch) | |
tree | 8eb64126907286ce6ee2ec38c366892ebcd457b7 | |
parent | 4cf3271443a3572189aff5ce13cb737ba1b7cadc (diff) |
Fix out of bounds access
Fixes coverity CID155661, 155660, 155659.
Change-Id: I914e321d3eda2a86916fa3ffa667d27b9a726f4b
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r-- | src/imports/controls/universal/qquickuniversalprogressring.cpp | 2 | ||||
-rw-r--r-- | src/imports/controls/universal/qquickuniversalprogressstrip.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/imports/controls/universal/qquickuniversalprogressring.cpp b/src/imports/controls/universal/qquickuniversalprogressring.cpp index f69ad704..38931525 100644 --- a/src/imports/controls/universal/qquickuniversalprogressring.cpp +++ b/src/imports/controls/universal/qquickuniversalprogressring.cpp @@ -121,7 +121,7 @@ void QQuickUniversalProgressRingAnimatorJob::updateCurrentTime(int time) if (visible) { int phaseIndex, remain = time, elapsed = 0; - for (phaseIndex = 0; phaseIndex < PhaseCount; ++phaseIndex) { + for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { if (remain <= m_phases[phaseIndex].duration + begin) break; remain -= m_phases[phaseIndex].duration; diff --git a/src/imports/controls/universal/qquickuniversalprogressstrip.cpp b/src/imports/controls/universal/qquickuniversalprogressstrip.cpp index c22af2b6..1ae5b371 100644 --- a/src/imports/controls/universal/qquickuniversalprogressstrip.cpp +++ b/src/imports/controls/universal/qquickuniversalprogressstrip.cpp @@ -148,7 +148,7 @@ void QQuickUniversalProgressStripAnimatorJob::updateCurrentTime(int time) if (visible) { { int phaseIndex, remain = time, elapsed = 0; - for (phaseIndex = 0; phaseIndex < PhaseCount; ++phaseIndex) { + for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { if (remain <= m_borderPhases[phaseIndex].duration + begin) break; remain -= m_borderPhases[phaseIndex].duration; @@ -171,7 +171,7 @@ void QQuickUniversalProgressStripAnimatorJob::updateCurrentTime(int time) curve.addCubicBezierSegment(QPointF(0.4, 0.0), QPointF(0.6, 1.0), QPointF(1.0, 1.0)); int phaseIndex, remain = time, elapsed = 0; - for (phaseIndex = 0; phaseIndex < PhaseCount; ++phaseIndex) { + for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { if (remain <= m_ellipsePhases[phaseIndex].duration + begin) break; remain -= m_ellipsePhases[phaseIndex].duration; |