diff options
Diffstat (limited to 'tests/auto/qtessellator/dataparser.cpp')
-rw-r--r-- | tests/auto/qtessellator/dataparser.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/qtessellator/dataparser.cpp b/tests/auto/qtessellator/dataparser.cpp index 772f925..8ad7ae8 100644 --- a/tests/auto/qtessellator/dataparser.cpp +++ b/tests/auto/qtessellator/dataparser.cpp @@ -98,8 +98,12 @@ static QList<QPointF> parsePoints(const QByteArray &line) QList<qreal> nums = parseNumbersList(it); QList<qreal>::const_iterator nitr; for (nitr = nums.begin(); nitr != nums.end(); ++nitr) { - qreal x = *nitr; ++nitr; - Q_ASSERT(nitr != nums.end()); + qreal x = *nitr; + ++nitr; + if (nitr == nums.end()) { + qWarning() << "parsePoints: Even number of co-ordinates required, odd number found: skipping last point"; + break; + } qreal y = *nitr; res.append(QPointF(x, y)); } |