Merge pull request #3229 from assimp/qarmin-added_check_before_using

Qarmin added check before using
pull/3214/head^2
Kim Kulling 2020-05-17 13:53:44 +02:00 committed by GitHub
commit 9566284873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

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