Skip to content

Commit 6fd73d2

Browse files
committed
Fixed an issue of index out of bounds under specific conditions
1 parent 54e8237 commit 6fd73d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/src/main/java/com/xtracr/realcamera/util/IterableVertexBuffer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public PrimitiveIterator() {
321321
for (int i = 0; i < primitiveLength; i++) {
322322
reusablePrimitive[i] = VertexData.mutable();
323323
}
324-
readVertexAt(0, reusablePrimitive[0]);
324+
if (0 < vertexCount) readVertexAt(0, reusablePrimitive[0]);
325325
}
326326

327327
@Override
@@ -348,7 +348,7 @@ public PrimitiveSpliterator(int start, int end) {
348348
for (int i = 0; i < primitiveLength; i++) {
349349
reusablePrimitive[i] = VertexData.mutable();
350350
}
351-
readVertexAt(0, reusablePrimitive[0]);
351+
if (0 < vertexCount) readVertexAt(0, reusablePrimitive[0]);
352352
}
353353

354354
@Override

0 commit comments

Comments
 (0)