Avoid undefined-shift in Assimp::ASE::Parser::ParseLV4MeshFace.

pull/4829/head
Kim Kulling 2022-12-05 13:07:52 +01:00
parent 28c155bfb4
commit 81f85a6f93
2 changed files with 10 additions and 7 deletions

View File

@ -1774,7 +1774,13 @@ void Parser::ParseLV4MeshFace(ASE::Face &out) {
// FIX: There needn't always be a value, sad but true // FIX: There needn't always be a value, sad but true
while (true) { while (true) {
if (*filePtr < '9' && *filePtr >= '0') { if (*filePtr < '9' && *filePtr >= '0') {
uint32_t value = strtoul10(filePtr, &filePtr);
if (value < 32) {
out.iSmoothGroup |= (1 << strtoul10(filePtr, &filePtr)); out.iSmoothGroup |= (1 << strtoul10(filePtr, &filePtr));
} else {
const std::string message = std::string("Unable to set smooth group, value with ") + ai_to_string(value) + std::string(" out of range");
LogWarning(message.c_str());
}
} }
SkipSpaces(&filePtr); SkipSpaces(&filePtr);
if (',' != *filePtr) { if (',' != *filePtr) {

View File

@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2022, assimp team Copyright (c) 2006-2022, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -385,12 +384,10 @@ struct Dummy : public BaseNode {
/** \brief Class to parse ASE files /** \brief Class to parse ASE files
*/ */
class Parser { class Parser {
private:
Parser() AI_NO_EXCEPT {
// empty
}
public: public:
/// @brief No default constructor.
Parser() AI_NO_EXCEPT = delete
// ------------------------------------------------------------------- // -------------------------------------------------------------------
//! Construct a parser from a given input file which is //! Construct a parser from a given input file which is
//! guaranteed to be terminated with zero. //! guaranteed to be terminated with zero.