diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-05-11 15:52:23 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-05-11 18:57:17 +0200 |
commit | 9d2850bda946fab28f689d284fd670e5cf361d8f (patch) | |
tree | 83045678995470d04746cf6c67420111242969a4 /src | |
parent | f5c69a5195684bf11a4d55c189435eea35e66125 (diff) |
Avoid potential read of uninitialized clip data
Set clip->count to 0 unconditional not just when hasRegionClip or
hasRectClip is true.
Pick-to: 6.1
Change-Id: Ib3d1c4dc24373df3d4dbc393241226a8730bb9fc
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 3ce5b08326..de17bff844 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3831,6 +3831,7 @@ void QClipData::initialize() Q_CHECK_PTR(m_clipLines); QT_TRY { allocated = clipSpanHeight; + count = 0; QT_TRY { if (hasRegionClip) { const auto rects = clipRegion.begin(); @@ -3842,7 +3843,6 @@ void QClipData::initialize() int y = 0; int firstInBand = 0; - count = 0; while (firstInBand < numRects) { const int currMinY = rects[firstInBand].y(); const int currMaxY = currMinY + rects[firstInBand].height(); @@ -3900,7 +3900,6 @@ void QClipData::initialize() } const int len = clipRect.width(); - count = 0; while (y < ymax) { QSpan *span = m_spans + count; span->x = xmin; |