From 9d2850bda946fab28f689d284fd670e5cf361d8f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 11 May 2021 15:52:23 +0200 Subject: 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 --- src/gui/painting/qpaintengine_raster.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3