Skip to content

Commit

Permalink
Fix mem alloc for nvgVertices
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBRDeveloper committed Apr 15, 2024
1 parent b3071b5 commit e4b2368
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/lwjgl/nanovg/src/main/c/nanovg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2466,9 +2466,11 @@ static int nvg__isTransformFlipped(const float *xform)
void nvgVertices(NVGcontext* ctx, const float* vertices) {
int size = sizeof(vertices) / sizeof(vertices[0]);

NVGvertex* verts;
NVGvertex* verts = nvg__allocTempVerts(ctx, size/4);
NVGstate* state = nvg__getState(ctx);



int num = 0;
for(int i = 0; i < size; i += 4) {
nvg__vset(&verts[num], vertices[i], vertices[i+1], vertices[i+2], vertices[i+3]);
Expand Down

0 comments on commit e4b2368

Please sign in to comment.