Fix garbage messages in SIB, MD2, and MDC loaders.

This commit is contained in:
Jason C
2021-05-04 21:24:44 -04:00
parent a9fb1e56ae
commit 9a04f5d4b0
3 changed files with 20 additions and 32 deletions

View File

@@ -68,6 +68,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/scene.h>
#include <assimp/DefaultLogger.hpp>
#include <assimp/IOSystem.hpp>
#include <assimp/StringUtils.h>
#include <map>
@@ -166,14 +167,14 @@ static aiColor3D ReadColor(StreamReaderLE *stream) {
}
static void UnknownChunk(StreamReaderLE * /*stream*/, const SIBChunk &chunk) {
char temp[5] = {
char temp[4] = {
static_cast<char>((chunk.Tag >> 24) & 0xff),
static_cast<char>((chunk.Tag >> 16) & 0xff),
static_cast<char>((chunk.Tag >> 8) & 0xff),
static_cast<char>(chunk.Tag & 0xff), '\0'
static_cast<char>(chunk.Tag & 0xff)
};
ASSIMP_LOG_WARN((Formatter::format(), "SIB: Skipping unknown '", temp, "' chunk."));
ASSIMP_LOG_WARN((Formatter::format(), "SIB: Skipping unknown '", ai_str_toprintable(temp, 4), "' chunk."));
}
// Reads a UTF-16LE string and returns it at UTF-8.