From bc66fcb7846f5d7dccaadb9c5a99b5fc9d9c7f50 Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Thu, 19 Sep 2024 15:46:34 +0200 Subject: [PATCH] SegmentVisitor: fix crash if vertexCount is 0 Change-Id: I97a981f65cad1e2f08f90b72adfbd4945cdc2f8b Reviewed-by: Mike Krus (cherry picked from commit 26577c869f42d51fac29d282469c3ebe71974513) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 5a5b8438f4556d093236ee59e4a7d77844a61050) --- src/render/backend/segmentsvisitor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/render/backend/segmentsvisitor.cpp b/src/render/backend/segmentsvisitor.cpp index 16fa0ec0e..c6b38da62 100644 --- a/src/render/backend/segmentsvisitor.cpp +++ b/src/render/backend/segmentsvisitor.cpp @@ -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);