Просмотр исходного кода

Merge pull request #444 from Einarin/master

Check that zlib initialized correctly in FBX parser
Alexander Gessler 10 лет назад
Родитель
Сommit
707c65283d
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      code/FBXParser.cpp

+ 3 - 1
code/FBXParser.cpp

@@ -549,7 +549,9 @@ void ReadBinaryDataArray(char type, uint32_t count, const char*& data, const cha
 		zstream.data_type = Z_BINARY;
 
 		// http://hewgill.com/journal/entries/349-how-to-decompress-gzip-stream-with-zlib
-		inflateInit(&zstream);
+		if(Z_OK != inflateInit(&zstream)) {
+			ParseError("failure initializing zlib");
+		}
 
 		zstream.next_in   = reinterpret_cast<Bytef*>( const_cast<char*>(data) );
 		zstream.avail_in  = comp_len;