Browse Source

Merge branch 'added_check_before_using' of https://github.com/qarmin/assimp into qarmin-added_check_before_using

Kim Kulling 5 years ago
parent
commit
4f24b3dac2
1 changed files with 3 additions and 3 deletions
  1. 3 3
      code/AssetLib/glTF/glTFCommon.cpp

+ 3 - 3
code/AssetLib/glTF/glTFCommon.cpp

@@ -145,13 +145,13 @@ bool ParseDataURI(const char *const_uri, size_t uriLen, DataURI &out) {
         size_t i = 5, j;
         if (uri[i] != ';' && uri[i] != ',') { // has media type?
             uri[1] = char(i);
-            for (; uri[i] != ';' && uri[i] != ',' && i < uriLen; ++i) {
+            for (;i < uriLen && uri[i] != ';' && uri[i] != ','; ++i) {
                 // nothing to do!
             }
         }
-        while (uri[i] == ';' && i < uriLen) {
+        while (i < uriLen && uri[i] == ';') {
             uri[i++] = '\0';
-            for (j = i; uri[i] != ';' && uri[i] != ',' && i < uriLen; ++i) {
+            for (j = i; i < uriLen && uri[i] != ';' && uri[i] != ','; ++i) {
                 // nothing to do!
             }