Update ObjFileParser.cpp

Ensure not checking empty strings
kimkulling/fix_gcc-14_issue-5592
Kim Kulling 2024-05-26 18:19:56 +02:00 committed by GitHub
parent 30466aaf16
commit 98a18dbd37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -582,10 +582,12 @@ void ObjFileParser::getMaterialDesc() {
skip = true; skip = true;
} }
// If the current mesh has the same material, we simply ignore that 'usemtl' command // If the current mesh has the same material, we will ignore that 'usemtl' command
// There is no need to create another object or even mesh here // There is no need to create another object or even mesh here
if (m_pModel->mCurrentMaterial && m_pModel->mCurrentMaterial->MaterialName == aiString(strName)) { if (!skip) {
skip = true; if (m_pModel->mCurrentMaterial && m_pModel->mCurrentMaterial->MaterialName == aiString(strName)) {
skip = true;
}
} }
if (!skip) { if (!skip) {