From 101a5e506f77eb0a7282a4b5865fe498c954b049 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Mon, 15 Nov 2021 16:48:46 -0600 Subject: [PATCH 1/2] Fix all files being allowed past the suffix check for images --- src/text_file_functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index aedf3b8..d873b3c 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -517,7 +517,7 @@ QString AOApplication::get_sfx_suffix(VPath sound_to_check) QString AOApplication::get_image_suffix(VPath path_to_check, bool static_image) { - QStringList suffixes { "" }; + QStringList suffixes {}; if (!static_image) { suffixes.append({ ".webp", ".apng", ".gif" }); } From 658a1ae624e4757a580543dfab149d868ec7636c Mon Sep 17 00:00:00 2001 From: in1tiate Date: Mon, 15 Nov 2021 17:03:36 -0600 Subject: [PATCH 2/2] Add an explicit check for empty string to dir_exists --- src/file_functions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/file_functions.cpp b/src/file_functions.cpp index 37cdc32..95e9b5f 100644 --- a/src/file_functions.cpp +++ b/src/file_functions.cpp @@ -12,6 +12,9 @@ bool file_exists(QString file_path) bool dir_exists(QString dir_path) { + if (dir_path == "") + return false; + QDir check_dir(dir_path); return check_dir.exists();