summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengineex.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2014-06-05 23:23:07 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-09 12:35:02 +0200
commit9a3a3b641a11022a69d77840714da13d8c5c4d5e (patch)
tree3ab2951cf0428a1d19e7dcdcfe5131e62e0dd4e6 /src/gui/painting/qpaintengineex.cpp
parentd6525a6c1011bfec337d9403ab8cb5724dc8fdfb (diff)
Don't try to draw if there are no points in the path
In some cases, for instance if drawEllipse() was called with a null QRect then it would still try to draw a QVectorPath without having enough points in the list. Therefore the point_count should be checked first before doing any drawing. Change-Id: I9b8dbb87c73b74e9df9eb10ec790a484d05d4c46 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/gui/painting/qpaintengineex.cpp')
-rw-r--r--src/gui/painting/qpaintengineex.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index e75a59cc91..8487cf2394 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -830,6 +830,8 @@ void QPaintEngineEx::drawEllipse(const QRectF &r)
int point_count = 0;
x.points[0] = qt_curves_for_arc(r, 0, -360, x.points + 1, &point_count);
+ if (point_count == 0)
+ return;
QVectorPath vp((qreal *) pts, point_count + 1, qpaintengineex_ellipse_types, QVectorPath::EllipseHint);
draw(vp);
}