aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcurveprocessor.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2024-02-07 13:29:49 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2024-02-08 14:37:02 +0000
commit83b94cadca650341c5b853d51b08ab729b952a13 (patch)
tree9ec040c44c90fb1ea58479c88b946afa400f1202 /src/quick/scenegraph/qsgcurveprocessor.cpp
parent5ea6200ec460a3cb040c429ced8cdac11fe924bf (diff)
curve renderer: Fix crash when splitting elements
We would take a reference to the element and then modify the path, which would cause us to read uninitialized memory and later assert. Pick-to: 6.7 Change-Id: Ib8f3e289dea44fdd6f51649de776b7fba63c62d9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgcurveprocessor.cpp')
-rw-r--r--src/quick/scenegraph/qsgcurveprocessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgcurveprocessor.cpp b/src/quick/scenegraph/qsgcurveprocessor.cpp
index 753cfd9aa5..c2c4932399 100644
--- a/src/quick/scenegraph/qsgcurveprocessor.cpp
+++ b/src/quick/scenegraph/qsgcurveprocessor.cpp
@@ -455,8 +455,9 @@ static void splitElementIfNecessary(QQuadPath &path, int index)
if (needsSplit(e))
path.splitElementAt(index);
} else {
- for (int i = 0; i < e.childCount(); ++i)
- splitElementIfNecessary(path, e.indexOfChild(i));
+ const int childCount = e.childCount();
+ for (int i = 0; i < childCount; ++i)
+ splitElementIfNecessary(path, path.indexOfChildAt(index, i));
}
}