Merge pull request #455 from turol/master

Fix some infinite loops
This commit is contained in:
Alexander Gessler
2015-02-01 12:54:15 +01:00
2 changed files with 6 additions and 3 deletions

View File

@@ -436,7 +436,7 @@ bool PLY::DOM::ParseHeader (const char* pCur,const char** pCurOut,bool isBinary)
*pCurOut = pCur;
// parse all elements
while (true)
while ((*pCur) != '\0')
{
// skip all comments
PLY::DOM::SkipComments(pCur,&pCur);

View File

@@ -308,6 +308,7 @@ void STLImporter::LoadASCIIFile()
{
if (3 == curVertex) {
DefaultLogger::get()->error("STL: a facet with more than 3 vertices has been found");
++sz;
}
else
{
@@ -326,8 +327,10 @@ void STLImporter::LoadASCIIFile()
break;
}
// else skip the whole identifier
else while (!::IsSpaceOrNewLine(*sz)) {
++sz;
else {
do {
++sz;
} while (!::IsSpaceOrNewLine(*sz));
}
}