Commit 92d0d9b3 authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed crash in OFF Reader with empty lines (Thanks to R.Schneider for the fix)

git-svn-id: fdac6126-5c0c-442c-9429-916003d36597
parent c1017f5a
......@@ -365,9 +365,9 @@ int _OFFReader_::getColorType(std::string& _line, bool _texCoordsAvailable) cons
return 0;
//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);
while (std::isspace(_line[ _line.length()-1 ]))
while (_line.size() > 0 && std::isspace(_line[ _line.length()-1 ]))
_line = _line.substr(0, _line.length()-1);
//count the remaining items in the line
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment