Skip to content

Commit

Permalink
Fix PolylineCollection indices arrays (CesiumGS#5538)
Browse files Browse the repository at this point in the history
A 64K buffer limit overflow test was wrong, leading to out-of range vertice indices.
  • Loading branch information
Florent Cayré committed Aug 25, 2017
1 parent 0ddf803 commit 809fa27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Scene/PolylineCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ define([
for ( var j = 0; j < numberOfSegments; ++j) {
var segmentLength = segments[j] - 1.0;
for ( var k = 0; k < segmentLength; ++k) {
if (indicesCount + 4 >= CesiumMath.SIXTY_FOUR_KILOBYTES - 2) {
if (indicesCount + 4 > CesiumMath.SIXTY_FOUR_KILOBYTES) {
polyline._locatorBuckets.push({
locator : bucketLocator,
count : segmentIndexCount
Expand Down Expand Up @@ -1489,7 +1489,7 @@ define([
count : segmentIndexCount
});

if (indicesCount + 4 >= CesiumMath.SIXTY_FOUR_KILOBYTES - 2) {
if (indicesCount + 4 > CesiumMath.SIXTY_FOUR_KILOBYTES) {
vertexBufferOffset.push(0);
indices = [];
totalIndices.push(indices);
Expand Down

0 comments on commit 809fa27

Please sign in to comment.