Browse Source

Merge pull request #192 from AIM360/FaultToleranceFor3DSLoader

3DSLoader: Skipped chunks of size 0
Alexander Gessler 11 years ago
parent
commit
d6a3df0acf
1 changed files with 2 additions and 0 deletions
  1. 2 0
      code/3DSLoader.cpp

+ 2 - 0
code/3DSLoader.cpp

@@ -79,6 +79,8 @@ static const aiImporterDesc desc = {
 	Discreet3DS::Chunk chunk;                                            \
 	ReadChunk(&chunk);                                                   \
 	int chunkSize = chunk.Size-sizeof(Discreet3DS::Chunk);	             \
+    if(chunkSize <= 0)                                                   \
+        continue;                                                        \
 	const int oldReadLimit = stream->GetReadLimit();                     \
 	stream->SetReadLimit(stream->GetCurrentPos() + chunkSize);           \