Merge branch 'assimp:master' into collada-ignore-unit-size-property
commit
d8a7399a04
|
@ -271,10 +271,16 @@ void MDLImporter::InternReadFile(const std::string &pFile,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Check whether we're still inside the valid file range
|
||||||
|
bool MDLImporter::IsPosValid(const void *szPos) const {
|
||||||
|
return szPos && (const unsigned char *)szPos <= this->mBuffer + this->iFileSize && szPos >= this->mBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Check whether we're still inside the valid file range
|
// Check whether we're still inside the valid file range
|
||||||
void MDLImporter::SizeCheck(const void *szPos) {
|
void MDLImporter::SizeCheck(const void *szPos) {
|
||||||
if (!szPos || (const unsigned char *)szPos > this->mBuffer + this->iFileSize || szPos < this->mBuffer) {
|
if (!IsPosValid(szPos)) {
|
||||||
throw DeadlyImportError("Invalid MDL file. The file is too small "
|
throw DeadlyImportError("Invalid MDL file. The file is too small "
|
||||||
"or contains invalid data.");
|
"or contains invalid data.");
|
||||||
}
|
}
|
||||||
|
@ -284,7 +290,7 @@ void MDLImporter::SizeCheck(const void *szPos) {
|
||||||
// Just for debugging purposes
|
// Just for debugging purposes
|
||||||
void MDLImporter::SizeCheck(const void *szPos, const char *szFile, unsigned int iLine) {
|
void MDLImporter::SizeCheck(const void *szPos, const char *szFile, unsigned int iLine) {
|
||||||
ai_assert(nullptr != szFile);
|
ai_assert(nullptr != szFile);
|
||||||
if (!szPos || (const unsigned char *)szPos > mBuffer + iFileSize) {
|
if (!IsPosValid(szPos)) {
|
||||||
// remove a directory if there is one
|
// remove a directory if there is one
|
||||||
const char *szFilePtr = ::strrchr(szFile, '\\');
|
const char *szFilePtr = ::strrchr(szFile, '\\');
|
||||||
if (!szFilePtr) {
|
if (!szFilePtr) {
|
||||||
|
|
|
@ -150,6 +150,7 @@ protected:
|
||||||
*/
|
*/
|
||||||
void SizeCheck(const void* szPos);
|
void SizeCheck(const void* szPos);
|
||||||
void SizeCheck(const void* szPos, const char* szFile, unsigned int iLine);
|
void SizeCheck(const void* szPos, const char* szFile, unsigned int iLine);
|
||||||
|
bool IsPosValid(const void* szPos) const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Validate the header data structure of a game studio MDL7 file
|
/** Validate the header data structure of a game studio MDL7 file
|
||||||
|
|
|
@ -94,6 +94,7 @@ enum aiPostProcessSteps
|
||||||
* indexed geometry, this step is compulsory or you'll just waste rendering
|
* indexed geometry, this step is compulsory or you'll just waste rendering
|
||||||
* time. <b>If this flag is not specified</b>, no vertices are referenced by
|
* time. <b>If this flag is not specified</b>, no vertices are referenced by
|
||||||
* more than one face and <b>no index buffer is required</b> for rendering.
|
* more than one face and <b>no index buffer is required</b> for rendering.
|
||||||
|
* Unless the importer (like ply) had to split vertices. Then you need one regardless.
|
||||||
*/
|
*/
|
||||||
aiProcess_JoinIdenticalVertices = 0x2,
|
aiProcess_JoinIdenticalVertices = 0x2,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue