Skip to content

Commit 10291e5

Browse files
author
Florent Cayré
committed
Fix PolylineCollection indices arrays (CesiumGS#5538)
A 64K buffer limit overflow test was wrong, leading to out-of range vertice indices.
1 parent 0ddf803 commit 10291e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/Scene/PolylineCollection.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ define([
14571457
for ( var j = 0; j < numberOfSegments; ++j) {
14581458
var segmentLength = segments[j] - 1.0;
14591459
for ( var k = 0; k < segmentLength; ++k) {
1460-
if (indicesCount + 4 >= CesiumMath.SIXTY_FOUR_KILOBYTES - 2) {
1460+
if (indicesCount + 4 > CesiumMath.SIXTY_FOUR_KILOBYTES) {
14611461
polyline._locatorBuckets.push({
14621462
locator : bucketLocator,
14631463
count : segmentIndexCount
@@ -1489,7 +1489,7 @@ define([
14891489
count : segmentIndexCount
14901490
});
14911491

1492-
if (indicesCount + 4 >= CesiumMath.SIXTY_FOUR_KILOBYTES - 2) {
1492+
if (indicesCount + 4 > CesiumMath.SIXTY_FOUR_KILOBYTES) {
14931493
vertexBufferOffset.push(0);
14941494
indices = [];
14951495
totalIndices.push(indices);

0 commit comments

Comments
 (0)