Kaynağa Gözat

Fixed crash when reading out of bounds.

Бранимир Караџић 6 yıl önce
ebeveyn
işleme
6fc9933183
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. 5 0
      src/image.cpp

+ 5 - 0
src/image.cpp

@@ -252,6 +252,11 @@ namespace bimg
 
 	const char* getName(TextureFormat::Enum _format)
 	{
+		if (_format >= TextureFormat::Count)
+		{
+			return "Unknown?!";
+		}
+
 		return s_textureFormatName[_format];
 	}