Explorar el Código

Merge pull request #313 from ajshort/patch-1

Fix overflow in STL header colour reading.
Alexander Gessler hace 11 años
padre
commit
cd88ea745d
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      code/STLLoader.cpp

+ 2 - 2
code/STLLoader.cpp

@@ -348,8 +348,8 @@ bool STLImporter::LoadBinaryFile()
 	bool bIsMaterialise = false;
 
 	// search for an occurence of "COLOR=" in the header
-	const char* sz2 = (const char*)mBuffer;
-	const char* const szEnd = sz2+80;
+	const unsigned char* sz2 = (const unsigned char*)mBuffer;
+	const unsigned char* const szEnd = sz2+80;
 	while (sz2 < szEnd)	{
 
 		if ('C' == *sz2++ && 'O' == *sz2++ && 'L' == *sz2++ &&