adding check on low number of vertices fixes Mac OSX crash

This commit is contained in:
Erwin Coumans
2014-01-16 15:53:53 -08:00
parent edb0c72166
commit 0ed7b5c508
2 changed files with 8 additions and 8 deletions

View File

@@ -189,8 +189,8 @@ int clipFaceGlobal(__global const float4* pVtxIn, int numVertsIn, float4 planeNo
float ds, de;
int numVertsOut = 0;
//double-check next test
// if (numVertsIn < 2)
// return 0;
if (numVertsIn < 2)
return 0;
float4 firstVertex=pVtxIn[numVertsIn-1];
float4 endVertex = pVtxIn[0];
@@ -239,8 +239,8 @@ int clipFace(const float4* pVtxIn, int numVertsIn, float4 planeNormalWS,float pl
float ds, de;
int numVertsOut = 0;
//double-check next test
// if (numVertsIn < 2)
// return 0;
if (numVertsIn < 2)
return 0;
float4 firstVertex=pVtxIn[numVertsIn-1];
float4 endVertex = pVtxIn[0];

View File

@@ -568,8 +568,8 @@ static const char* satClipKernelsCL= \
" float ds, de;\n"
" int numVertsOut = 0;\n"
" //double-check next test\n"
" // if (numVertsIn < 2)\n"
" // return 0;\n"
" if (numVertsIn < 2)\n"
" return 0;\n"
" \n"
" float4 firstVertex=pVtxIn[numVertsIn-1];\n"
" float4 endVertex = pVtxIn[0];\n"
@@ -615,8 +615,8 @@ static const char* satClipKernelsCL= \
" float ds, de;\n"
" int numVertsOut = 0;\n"
"//double-check next test\n"
"// if (numVertsIn < 2)\n"
"// return 0;\n"
" if (numVertsIn < 2)\n"
" return 0;\n"
" float4 firstVertex=pVtxIn[numVertsIn-1];\n"
" float4 endVertex = pVtxIn[0];\n"
" \n"