Fix buffer size mismatch in rare fallback path in Qt Quick Shapes/GeometryRenderer


For index buffers with odd number counts and in the case where
qTriangulate() returns 16-bit indexes, we would truncate the number, so
the memcpy() into the buffer would write past the buffer by one short.
The code path is only reachable on systems where 32-bit indexes are
unsupported, such as GLES2 without extension GL_OES_element_index_uint.
On these systems, static shapes will fail to render at all because we
always create 32-bit index buffers and only make them 16-bit when
updating (separate bug).

So in practice, Qt Quick Shapes is not really usable on such platforms.

Fixes: QTBUG-151299
Pick-to: 6.8 6.12
Change-Id: I242d417c289b57bb3b00901c8389594dce6ab57a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
commit676423dd3baa884ae3acb457e1135f180b652bc8
parentde65a6720f3349ed98f729c93400a71fd44316ef
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
commit timeFri, 9 Oct 2026 17:56:05 +0000