diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-08-15 13:24:06 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-08-15 13:24:52 -0300 |
commit | c627f3a707b9dc052e6665f1a5b1268862a90642 (patch) | |
tree | 73faebc5d16bd1bd8621fb4ebc5bb756eda11cad | |
parent | d006aa0abb1c7580755a4fe72502d3a362d3f01f (diff) |
Attempting to workaround the problem present in #20904, let me know if it works.
-rw-r--r-- | scene/resources/texture.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 2f663431de..96edb17eea 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -621,7 +621,11 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla memdelete(f); - if (bytes != total_size - ofs) { + int expected = total_size - ofs; + if (bytes < expected) { + //this is a compatibility workaround for older format, which saved less mipmaps. It is still recommended the image is reimported. + zeromem(w.ptr() + bytes, (expected - bytes)); + } else if (bytes != expected) { ERR_FAIL_V(ERR_FILE_CORRUPT); } } |