|
|
@@ -304,7 +304,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
|
|
|
+ const l = Math.min( points.length, positionAttribute.count ); // make sure data do not exceed buffer size
|
|
|
+
|
|
|
+ for ( let i = 0; i < l; i ++ ) {
|
|
|
|
|
|
const point = points[ i ];
|
|
|
positionAttribute.setXYZ( i, point.x, point.y, point.z || 0 );
|