osmbuildings/building code: Fix buffer overflows in the sphere code
The sphere code overflowed the arrays since it reallocated
based on:
sphereVertexCount = sphereStackCount * (sphereSectorCount + 1);
and then looped over:
for (stackIndex = 0; stackIndex <=sphereStackCount; ...)
for (sectorIndex = 0; sectorIndex <= sphereSectorCount; ...)
Fix the vertex count to be:
(sphereStackCount + 1) * (sphereSectorCount + 1)
and calculate the index count correct (it writes only one triple for
the first/last stack).
Pick-to: 6.12 6.11 6.8
Change-Id: I6882d3faa5f560051967de6672dea030bfb0d267
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>