summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/doc_tools.cpp3
-rw-r--r--editor/editor_translation.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp
index 250182b8fc..a9d18e9dcc 100644
--- a/editor/doc_tools.cpp
+++ b/editor/doc_tools.cpp
@@ -1468,7 +1468,8 @@ Error DocTools::save_classes(const String &p_default_path, const Map<String, Str
Error DocTools::load_compressed(const uint8_t *p_data, int p_compressed_size, int p_uncompressed_size) {
Vector<uint8_t> data;
data.resize(p_uncompressed_size);
- Compression::decompress(data.ptrw(), p_uncompressed_size, p_data, p_compressed_size, Compression::MODE_DEFLATE);
+ int ret = Compression::decompress(data.ptrw(), p_uncompressed_size, p_data, p_compressed_size, Compression::MODE_DEFLATE);
+ ERR_FAIL_COND_V_MSG(ret == -1, ERR_FILE_CORRUPT, "Compressed file is corrupt.");
class_list.clear();
Ref<XMLParser> parser = memnew(XMLParser);
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());