diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-09-01 21:52:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-01 21:52:55 +0200 |
commit | dac150108ab3c1f41d5fd86cc6853f883064caaf (patch) | |
tree | 09195c9dd5e0d651e96b7d26f26985ab5ff6f871 /core/io/resource_format_binary.cpp | |
parent | 69ac4cbb3764a454194e27a7afe71d98af65c32c (diff) | |
parent | f9467ec1ea6c0dac2ea513b7dfe58d0349788e02 (diff) | |
download | redot-engine-dac150108ab3c1f41d5fd86cc6853f883064caaf.tar.gz |
Merge pull request #10846 from hpvb/fix-sign-compare
Fix signed and unsigned comparisons
Diffstat (limited to 'core/io/resource_format_binary.cpp')
-rw-r--r-- | core/io/resource_format_binary.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index f44492248e..d090d7a20b 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -102,7 +102,7 @@ StringName ResourceInteractiveLoaderBinary::_get_string() { uint32_t id = f->get_32(); if (id & 0x80000000) { - uint32_t len = id & 0x7FFFFFFF; + int len = id & 0x7FFFFFFF; if (len > str_buf.size()) { str_buf.resize(len); } @@ -336,9 +336,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { } break; case OBJECT_EXTERNAL_RESOURCE_INDEX: { //new file format, just refers to an index in the external list - uint32_t erindex = f->get_32(); + int erindex = f->get_32(); - if (erindex >= external_resources.size()) { + if (erindex < 0 || erindex >= external_resources.size()) { WARN_PRINT("Broken external resource! (index out of size"); r_v = Variant(); } else { |