From 6fc9933183d14298e0026dcc77b18056210863e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Mon, 22 Jul 2019 19:35:29 -0700 Subject: [PATCH] Fixed crash when reading out of bounds. --- src/image.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/image.cpp b/src/image.cpp index a454b84..015dab2 100644 --- a/src/image.cpp +++ b/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]; }