diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-01-04 07:39:22 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-01-04 07:44:26 (GMT) |
commit | cb470a33bf85cf15b9df57e3ade27c6a0720d138 (patch) | |
tree | bd4174e685dceb8da656ec11220ecd1420c0bc2b /src | |
parent | 8365b863419ad68f7dde7b7595e1b943ad9670ca (diff) | |
download | Qt-cb470a33bf85cf15b9df57e3ade27c6a0720d138.zip Qt-cb470a33bf85cf15b9df57e3ade27c6a0720d138.tar.gz Qt-cb470a33bf85cf15b9df57e3ade27c6a0720d138.tar.bz2 |
Fixed first element being a LineToElement in QPainterPath::connectPath()
This would produce an invalid path, causing potential crashes in various
parts of Qt.
Task-number: QTBUG-16377
Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index ffd0d5c..94e2cd4 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1196,7 +1196,8 @@ void QPainterPath::connectPath(const QPainterPath &other) int first = d->elements.size(); d->elements += other.d_func()->elements; - d->elements[first].type = LineToElement; + if (first != 0) + d->elements[first].type = LineToElement; // avoid duplicate points if (first > 0 && QPointF(d->elements[first]) == QPointF(d->elements[first - 1])) { |