MCPcopy Create free account
hub / github.com/crossuo/crossuo / DecompressBlock

Function DecompressBlock

xuocore/uodata.cpp:227–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227static bool DecompressBlock(const UopFileEntry *block, uint8_t *dst, uint8_t *src)
228{
229 assert(block);
230 uLongf cLen = block->CompressedSize;
231 uLongf dLen = block->DecompressedSize;
232 if (cLen == 0 || block->Flags == 0)
233 {
234 dst = src;
235 return true;
236 }
237
238 auto p = reinterpret_cast<unsigned char const *>(src);
239 int z_err = uncompress(dst, &dLen, p, cLen);
240 if (z_err != Z_OK)
241 {
242 Error(Data, "decompression failed %d", z_err);
243 return false;
244 }
245 return true;
246}
247
248static bool UopDecompressBlock(const UopFileEntry *block, uint8_t *dst, int fileId)
249{

Callers 2

UopDecompressBlockFunction · 0.85
GetDataMethod · 0.85

Calls 2

uncompressFunction · 0.85
ErrorFunction · 0.85

Tested by

no test coverage detected