Fixes DXF loader false positive on FBX file

A binary FBX file can have an header section `FBXHeaderVersion` which starts around the 70th byte.
Therefore, the token check for DXF file was hitting true because the `SearchFileHeaderForToken` is case insensitive.
We limit the scope of the token search to the first 32 bytes.
pull/1948/head
A. Breust 2018-05-07 15:16:32 +02:00 committed by GitHub
parent cce5647338
commit 50c5f3cb58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ bool DXFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
if ( extension.empty() || checkSig ) { if ( extension.empty() || checkSig ) {
static const char *pTokens[] = { "SECTION", "HEADER", "ENDSEC", "BLOCKS" }; static const char *pTokens[] = { "SECTION", "HEADER", "ENDSEC", "BLOCKS" };
return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 4 ); return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 4, 32 );
} }
return false; return false;