Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.6.2, 6.6.3, 6.7.0 RC2
-
None
-
1314d046f (dev), efa233bc4 (6.7)
Description
Using the Shape.CurveRenderer as the preferred renderer can cause crashes for certain line geometries when using a dash pattern.
The following QML example reproduces the crash (on Windows)
import QtQuick import QtQuick.Shapes Window { id: root; width: 640 height: 480 visible: true title: qsTr("Hello World") Shape { preferredRendererType: Shape.CurveRenderer; ShapePath { startX: -1.654507349898284; startY: 2.5602595487477107 dashPattern: [2, 2]; dashOffset: 4; strokeWidth: 5.8575662686300545; strokeColor: "purple"; capStyle: ShapePath.FlatCap; strokeStyle: ShapePath.DashLine; joinStyle: ShapePath.RoundJoin; PathLine { x: 119.95107002130986; y: 81.14499586882086 } } } }
This causes an assertion to be hit in the QQuadPath::dashed method:
... while (true) { bool gotAll = cutter.consume(pattern.at(dashIndex) - offset); ^^^^^^^^^ QVector2D nextPoint = cutter.currentCutPoint(); if (dashIndex & 1) ...
where dashIndex has the value 2, where pattern is a QVarLengthArray of length 2, causing an index out of bounds assertion: n <= size() - pos