Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jme3-core/src/main/java/com/jme3/scene/mesh/IndexBuffer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -77,7 +77,7 @@ public static IndexBuffer createIndexBuffer(int vertexCount,

if (vertexCount < 128) { // TODO: could be vertexCount <= 256
ByteBuffer buffer = BufferUtils.createByteBuffer(indexCount);
int maxIndexValue = vertexCount - 1;
int maxIndexValue = Math.max(0, vertexCount - 1);
result = new IndexByteBuffer(buffer, maxIndexValue);

} else if (vertexCount < 65536) { // TODO: could be <= 65536
Expand Down