From a3619183745f1db6562e92d62ce37207d49413c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 21 May 2015 17:49:02 -0700 Subject: [PATCH] Fixed issue #392. --- src/renderer_gl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 7370d0a1..4545f557 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -3276,8 +3276,11 @@ namespace bgfx { namespace gl *array = '\0'; array++; char* end = strchr(array, ']'); - *end = '\0'; - offset = atoi(array); + if (NULL != end) + { // Some devices (Amazon Fire) might not return terminating brace. + *end = '\0'; + offset = atoi(array); + } } switch (gltype)