From 5e0b516b83c86877a63b6853006119a35a368f88 Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Mon, 21 Oct 2024 22:12:26 -0400 Subject: [PATCH] Failure to extract media files from preset bundles. --- src/ZipFile.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ZipFile.cpp b/src/ZipFile.cpp index b3f5354..4c76c31 100644 --- a/src/ZipFile.cpp +++ b/src/ZipFile.cpp @@ -198,7 +198,12 @@ void ZipFileImpl::ExtractTo(const std::string &zipName, const std::filesystem::p zip_fclose(fIn); }}; + std::filesystem::create_directories(path.parent_path()); std::ofstream fo{path, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary}; + if (!fo.is_open()) + { + throw std::runtime_error(SS("Unable to open " << path)); + } constexpr int BUFFER_SIZE = 64 * 1024; std::vector vBuff(BUFFER_SIZE);