diff options
Diffstat (limited to 'src/gui/painting/qregion.cpp')
-rw-r--r-- | src/gui/painting/qregion.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 3fb6f925b3..1b8aae16e1 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -2281,7 +2281,14 @@ static void miRegionOp(QRegionPrivate &dest, dest.vectorize(); - QVector<QRect> oldRects = dest.rects; + /* + * The following calls are going to detach dest.rects. Since dest might be + * aliasing *reg1 and/or *reg2, and we could have active iterators on + * reg1->rects and reg2->rects (if the regions have more than 1 rectangle), + * take a copy of dest.rects to keep those iteractors valid. + */ + const QVector<QRect> destRectsCopy = dest.rects; + Q_UNUSED(destRectsCopy); dest.numRects = 0; @@ -3613,7 +3620,7 @@ static void PtsToRegion(int numFullPtBlocks, int iCurPtBlock, } if (rowSize) { - QPoint *next = i ? &pts[2] : (numFullPtBlocks && iCurPtBlock ? CurPtBlock->next->pts : Q_NULLPTR); + QPoint *next = i ? &pts[2] : (numFullPtBlocks && iCurPtBlock ? CurPtBlock->next->pts : nullptr); if (!next || next->y() != pts[0].y()) { flushRow(row.data(), pts[0].y(), rowSize, reg, &lastRow, &extendTo, &needsExtend); |