Fix md5-parsing

pull/5421/head
Kim Kulling 2024-01-30 10:16:07 +01:00
parent 2dd676d42a
commit 8632a16788
2 changed files with 9 additions and 8 deletions

View File

@ -468,16 +468,15 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
}
switch ((*it).GetType()) {
// closed line
case Surface::ClosedLine:
needMat[idx].first += (unsigned int)(*it).entries.size();
needMat[idx].second += (unsigned int)(*it).entries.size() << 1u;
case Surface::ClosedLine: // closed line
needMat[idx].first += static_cast<unsigned int>((*it).entries.size());
needMat[idx].second += static_cast<unsigned int>((*it).entries.size() << 1u);
break;
// unclosed line
case Surface::OpenLine:
needMat[idx].first += (unsigned int)(*it).entries.size() - 1;
needMat[idx].second += ((unsigned int)(*it).entries.size() - 1) << 1u;
needMat[idx].first += static_cast<unsigned int>((*it).entries.size() - 1);
needMat[idx].second += static_cast<unsigned int>(((*it).entries.size() - 1) << 1u);
break;
// triangle strip

View File

@ -263,7 +263,8 @@ inline bool AI_MD5_PARSE_STRING(const char **sz, const char *bufferEnd, aiString
szStart++;
if ('\"' != *(szEnd -= 1)) {
MD5Parser::ReportWarning("Expected closing quotation marks in string", linenumber);
return false;
++*sz;
//return false;
}
}
out.length = (ai_uint32)(szEnd - szStart);
@ -284,7 +285,8 @@ inline void AI_MD5_PARSE_STRING_IN_QUOTATION(const char **sz, const char *buffer
++*sz;
}
if ('\0' != **sz) {
const char *szEnd = (*sz++);
const char *szEnd = *sz;
++*sz;
out.length = (ai_uint32)(szEnd - szStart);
::memcpy(out.data, szStart, out.length);
}