Skip to content

Commit 3199e15

Browse files
Andrew HsiehGerrit Code Review
authored andcommitted
Merge "Fixed array-index-out-of-bound in Teapot sample"
2 parents cfb3c3f + f74a8b0 commit 3199e15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ndk/platforms/android-18/samples/Teapot/jni/TeapotRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void TeapotRenderer::init()
6262
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
6363

6464
//Create VBO
65-
_iNumVertices = sizeof(teapotPositions) / sizeof(teapotPositions[0]);
65+
_iNumVertices = sizeof(teapotPositions) / sizeof(teapotPositions[0]) / 3;
6666
int32_t iStride = sizeof(TEAPOT_VERTEX);
6767
int32_t iIndex = 0;
6868
TEAPOT_VERTEX* p = new TEAPOT_VERTEX[_iNumVertices];

0 commit comments

Comments
 (0)