summaryrefslogtreecommitdiffhomepage
path: root/loader/texture.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-12-02 16:12:20 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-12-02 18:58:28 +0100
commit99e2a55cec3b055b2eb9f64a534049e0d9bb22ab (patch)
tree0f903b1168887f16005628be2804c7391665c6da /loader/texture.cpp
parentdb50c7a6a38eff251a14d57dcb9ae551ffe3a1d6 (diff)
loader: check atlas name harder
1. don't duplicate checking logic 2. check for ascii null characters in names 3. allow space characters
Diffstat (limited to 'loader/texture.cpp')
-rw-r--r--loader/texture.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/loader/texture.cpp b/loader/texture.cpp
index 42940af2..6ffcc5d8 100644
--- a/loader/texture.cpp
+++ b/loader/texture.cpp
@@ -18,9 +18,8 @@ Trade::ImageData2D loader_impl::texture(StringView prefix, StringView filename_)
const auto N = prefix.size();
if (N > 0)
fm_assert(prefix[N-1] == '/');
- fm_soft_assert(filename_.size() < 4096);
- fm_soft_assert(filename_.find('\\') == filename_.end());
- fm_soft_assert(filename_.find('\0') == filename_.end());
+ fm_soft_assert(filename_.size() < 512);
+ fm_soft_assert(check_atlas_name(filename_));
fm_soft_assert(tga_importer);
constexpr std::size_t max_extension_length = 16;