diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-06-16 07:03:15 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-06-17 14:29:42 (GMT) |
commit | e3736c5031b941a665952a9696d989d79b25f32f (patch) | |
tree | 9f710909aebda6565bd4b854c020646f9192c28d /src | |
parent | c57e8b1e92c369c2aa507ebfa6cfebe18a282635 (diff) | |
download | Qt-e3736c5031b941a665952a9696d989d79b25f32f.zip Qt-e3736c5031b941a665952a9696d989d79b25f32f.tar.gz Qt-e3736c5031b941a665952a9696d989d79b25f32f.tar.bz2 |
Fixed segmentation fault caused by empty clip.
Make sure not to use the broken QRect constructor, and do an early check
on whether the clip rect is empty in QRasterizer::rasterizeLine().
Task-number: 254105
Reviewed-by: Trond
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qrasterizer.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 743c4b8..84af880 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3956,7 +3956,7 @@ void QRasterPaintEnginePrivate::initializeRasterizer(QSpanData *data) const QClipData *c = clip(); if (c) { const QRect r(QPoint(c->xmin, c->ymin), - QPoint(c->xmax, c->ymax)); + QSize(c->xmax - c->xmin, c->ymax - c->ymin)); clipRect = clipRect.intersected(r); blend = data->blend; } else { diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 629b38e..58e4b4e 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -703,7 +703,7 @@ static inline qreal qRoundF(qreal v) void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) { - if (a == b || width == 0) + if (a == b || width == 0 || d->clipRect.isEmpty()) return; QPointF pa = a; |