Fixes random crash when loading fbx files

pull/585/head
Marvin Pohl 2015-06-19 14:04:30 +01:00
parent 63ef641ae8
commit 927c9cb3ce
1 changed files with 3 additions and 3 deletions

View File

@ -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);
size_t readcnt = 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