diff options
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()); |