This commit is contained in:
Kawe Mazidjatari 2023-07-06 10:10:50 +02:00
parent 2e12a581e5
commit deb913e47b

View File

@ -494,7 +494,7 @@ int rcOffsetPoly(const float* verts, const int nverts, const float offset,
if (bevel && cross < 0.0f)
{
if (n+2 >= maxOutVerts)
if (n+2 > maxOutVerts)
return 0;
float d = (1.0f - (dx0*dx1 + dy0*dy1))*0.5f;
outVerts[n*3+0] = vb[0] + (-dlx0+dx0*d)*offset;
@ -508,7 +508,7 @@ int rcOffsetPoly(const float* verts, const int nverts, const float offset,
}
else
{
if (n+1 >= maxOutVerts)
if (n+1 > maxOutVerts)
return 0;
outVerts[n*3+0] = vb[0] - dmx*offset;
outVerts[n*3+1] = vb[1] - dmy*offset;