diff options
author | Ricardo Subtil <ricasubtil@gmail.com> | 2022-02-18 13:36:13 +0000 |
---|---|---|
committer | Ricardo Subtil <ricasubtil@gmail.com> | 2022-02-18 13:50:25 +0000 |
commit | 61790a03f5e63b79c8bf2c14c3f328480ba194a2 (patch) | |
tree | 46d459ee4b5f72c411e7a0955d34c4e2f4975e40 /editor/editor_translation.cpp | |
parent | 887d4bd0d985979d6c3fb33b053ce99486879956 (diff) | |
download | redot-engine-61790a03f5e63b79c8bf2c14c3f328480ba194a2.tar.gz |
Fix decompression functions not returning errcodes
Diffstat (limited to 'editor/editor_translation.cpp')
-rw-r--r-- | editor/editor_translation.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/editor_translation.cpp b/editor/editor_translation.cpp index 98248f3a87..f64adcf0a1 100644 --- a/editor/editor_translation.cpp +++ b/editor/editor_translation.cpp @@ -56,7 +56,8 @@ void load_editor_translations(const String &p_locale) { if (etl->lang == p_locale) { Vector<uint8_t> data; data.resize(etl->uncomp_size); - Compression::decompress(data.ptrw(), etl->uncomp_size, etl->data, etl->comp_size, Compression::MODE_DEFLATE); + int ret = Compression::decompress(data.ptrw(), etl->uncomp_size, etl->data, etl->comp_size, Compression::MODE_DEFLATE); + ERR_FAIL_COND_MSG(ret == -1, "Compressed file is corrupt."); FileAccessMemory *fa = memnew(FileAccessMemory); fa->open_custom(data.ptr(), data.size()); @@ -80,7 +81,8 @@ void load_doc_translations(const String &p_locale) { if (dtl->lang == p_locale) { Vector<uint8_t> data; data.resize(dtl->uncomp_size); - Compression::decompress(data.ptrw(), dtl->uncomp_size, dtl->data, dtl->comp_size, Compression::MODE_DEFLATE); + int ret = Compression::decompress(data.ptrw(), dtl->uncomp_size, dtl->data, dtl->comp_size, Compression::MODE_DEFLATE); + ERR_FAIL_COND_MSG(ret == -1, "Compressed file is corrupt."); FileAccessMemory *fa = memnew(FileAccessMemory); fa->open_custom(data.ptr(), data.size()); |