Fixed crash in OFF Reader with empty lines (Thanks to R.Schneider for the fix)
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@395 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -365,9 +365,9 @@ int _OFFReader_::getColorType(std::string& _line, bool _texCoordsAvailable) cons
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
//first remove spaces at start/end of the line
|
//first remove spaces at start/end of the line
|
||||||
while (std::isspace(_line[0]))
|
while (_line.size() > 0 && std::isspace(_line[0]))
|
||||||
_line = _line.substr(1);
|
_line = _line.substr(1);
|
||||||
while (std::isspace(_line[ _line.length()-1 ]))
|
while (_line.size() > 0 && std::isspace(_line[ _line.length()-1 ]))
|
||||||
_line = _line.substr(0, _line.length()-1);
|
_line = _line.substr(0, _line.length()-1);
|
||||||
|
|
||||||
//count the remaining items in the line
|
//count the remaining items in the line
|
||||||
|
|||||||
Reference in New Issue
Block a user