summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJason Barron <jason.barron@nokia.com>2010-07-14 14:12:04 (GMT)
committerJason Barron <jason.barron@nokia.com>2010-07-15 07:40:29 (GMT)
commit6d29bcc28c4ee9b7583a62d23a931b9389004966 (patch)
tree8814b0bd8262d4f6557a58e62bf2d9cf86ba9de4 /tests
parent7f339416471839ca9137b9ea1aa79f74fb565f4b (diff)
downloadQt-6d29bcc28c4ee9b7583a62d23a931b9389004966.zip
Qt-6d29bcc28c4ee9b7583a62d23a931b9389004966.tar.gz
Qt-6d29bcc28c4ee9b7583a62d23a931b9389004966.tar.bz2
Avoid a crash in the OpenVG paint engine when clipping to an empty path
The convertToPainterPath() function assumes that the QVectorPath contains at least one path element when creating the QPainterPath. This is not necessarily the case here though because if QVG_SCISSOR_CLIP is defined and setClipPath() is called with an empty QPainterPath, this is then converted to an empty QVectorPath in QPaintEngineEx::clip() which then calls QVGPaintEngine::clip(). This function then goes on to convert the QVectorPath back into a QPainterPath using the aforementioned function which crashes when attempting to access the first element of the path. In case you are wondering why this seemingly redundant conversion happens at all, it happens because when QVG_SCISSOR_CLIP is defined, we attempt to convert the path to a series of rects for scissor clipping and this conversion function operates on QPainterPath instead of QVectorPath which is what this clip() function was designed to deal with. The fix is to skip over the path conversion for empty paths and go directly to an empty QRegion. Reviewed-by: Alessandro Portale
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions