瀏覽代碼

Merge pull request #585 from pampersrocker/fbxLoadingFix

Fixes random crash when loading fbx files
Kim Kulling 10 年之前
父節點
當前提交
daabf4bf86
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      code/FBXImporter.cpp

+ 3 - 3
code/FBXImporter.cpp

@@ -151,9 +151,9 @@ void FBXImporter::InternReadFile( const std::string& pFile,
 	// streaming for its output data structures so the net win with
 	// streaming input data would be very low.
 	std::vector<char> contents;
-	contents.resize(stream->FileSize());
-
-	stream->Read(&*contents.begin(),contents.size(),1);
+	contents.resize(stream->FileSize()+1);
+    stream->Read( &*contents.begin(), 1, contents.size()-1 );
+    contents[ contents.size() - 1 ] = 0;
 	const char* const begin = &*contents.begin();
 
 	// broadphase tokenizing pass in which we identify the core