From 50c5f3cb581b729e7914b0825fe710009b1fe6a9 Mon Sep 17 00:00:00 2001 From: "A. Breust" Date: Mon, 7 May 2018 15:16:32 +0200 Subject: [PATCH] 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. --- code/DXFLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/DXFLoader.cpp b/code/DXFLoader.cpp index 90270bbd7..d317382dc 100644 --- a/code/DXFLoader.cpp +++ b/code/DXFLoader.cpp @@ -127,7 +127,7 @@ bool DXFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool if ( extension.empty() || checkSig ) { 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;