SegmentVisitor: fix crash if vertexCount is 0

Change-Id: I97a981f65cad1e2f08f90b72adfbd4945cdc2f8b
Reviewed-by: Mike Krus <mike.krus@kdab.com>
(cherry picked from commit 26577c869f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5a5b8438f4)
This commit is contained in:
Paul Lemire 2024-09-19 15:46:34 +02:00 committed by Qt Cherry-pick Bot
parent af19578563
commit bc66fcb784
1 changed files with 3 additions and 0 deletions

View File

@ -150,6 +150,9 @@ void traverseSegmentStrip(Vertex *vertices,
{
uint i = 0;
if (vertexInfo.count < 1)
return;
const uint verticesStride = vertexInfo.byteStride / sizeof(Vertex);
const uint maxVerticesDataSize = qMin(vertexInfo.dataSize, 3U);