mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-30 15:17:27 +00:00
unzip: check deflateInit and inflateInit results
This commit is contained in:
parent
132bb6db29
commit
ecfa77f6e7
@ -18,6 +18,10 @@ std::vector<u8> unzip(const void* src, usz size)
|
|||||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||||
#endif
|
#endif
|
||||||
int res = inflateInit2(&zs, 16 + 15);
|
int res = inflateInit2(&zs, 16 + 15);
|
||||||
|
if (res != Z_OK)
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
@ -79,6 +83,10 @@ bool unzip(const void* src, usz size, fs::file& out)
|
|||||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||||
#endif
|
#endif
|
||||||
int res = inflateInit(&strm);
|
int res = inflateInit(&strm);
|
||||||
|
if (res != Z_OK)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
@ -138,6 +146,10 @@ std::vector<u8> zip(const void* src, usz size)
|
|||||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||||
#endif
|
#endif
|
||||||
int res = deflateInit2(&zs, 9, Z_DEFLATED, 16 + 15, 9, Z_DEFAULT_STRATEGY);
|
int res = deflateInit2(&zs, 9, Z_DEFLATED, 16 + 15, 9, Z_DEFAULT_STRATEGY);
|
||||||
|
if (res != Z_OK)
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user