Fix a bug in the assbin loader that reads uninitialized memory (#5801)

* Fix a bug in the assbin loader that reads uninitialized memory

* Address review comment

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
This commit is contained in:
Qingyou Zhao
2024-10-18 11:41:47 -07:00
committed by GitHub
parent 4b9ac76815
commit a383cb1ff7

View File

@@ -91,9 +91,13 @@ bool AssbinImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, boo
}
char s[32];
in->Read(s, sizeof(char), 32);
const size_t read = in->Read(s, sizeof(char), 32);
pIOHandler->Close(in);
if (read < 19) {
return false;
}
return strncmp(s, "ASSIMP.binary-dump.", 19) == 0;
}