Hey guys, I am learning about LZ4 and Ive used the compression function with success already, but the decompression function inst just working.
Ive double checked the compressed and uncompressed sizes while compressing and stored before calling the LZ4_decompress_safe but,
Its returning the error: '-10' which I dont have idea what means.
So, how do we understand these errors?
This is how my code is working right now. (I have tried LZ4_decompress_fast but the debugger breaks when calling LZ4_decompress_generic)
//how arguments are arrenged
std::vector<unsigned char> outBuf;
outBuf.resize(65536);
char* dest = reinterpret_cast<char*>(outBuf.data());
char* srcBuf = reinterpret_cast<char*>(compressedData[x].data());
int rv = uncompressData(srcBuf, dest, compressedData[x].size(), outBuf.size());
int uncompressData(const char* inBuf, char* outBuf, int compressedSize, int UNCOMPRESSED_SIZE)
{
//UNCOMPRESSED_SIZE = 65536;
int rv = LZ4_decompress_safe(inBuf, outBuf, compressedSize, UNCOMPRESSED_SIZE);
if (rv < 1)
print("Couldn't run LZ4_decompress_safe()... error code received is in exit code. " + std::to_string(rv));
return rv;
}
Please, help XD