diff --git a/rpcs3/Crypto/unzip.cpp b/rpcs3/Crypto/unzip.cpp index f2d46f161a..04687942c2 100644 --- a/rpcs3/Crypto/unzip.cpp +++ b/rpcs3/Crypto/unzip.cpp @@ -18,6 +18,10 @@ std::vector unzip(const void* src, usz size) #pragma GCC diagnostic ignored "-Wold-style-cast" #endif int res = inflateInit2(&zs, 16 + 15); + if (res != Z_OK) + { + return {}; + } #ifndef _MSC_VER #pragma GCC diagnostic pop #endif @@ -79,6 +83,10 @@ bool unzip(const void* src, usz size, fs::file& out) #pragma GCC diagnostic ignored "-Wold-style-cast" #endif int res = inflateInit(&strm); + if (res != Z_OK) + { + return false; + } #ifndef _MSC_VER #pragma GCC diagnostic pop #endif @@ -138,6 +146,10 @@ std::vector zip(const void* src, usz size) #pragma GCC diagnostic ignored "-Wold-style-cast" #endif int res = deflateInit2(&zs, 9, Z_DEFLATED, 16 + 15, 9, Z_DEFAULT_STRATEGY); + if (res != Z_OK) + { + return {}; + } #ifndef _MSC_VER #pragma GCC diagnostic pop #endif