I have on a PC a 12288-byte buffer that has been compressed with the C# DeflateStream class, so generating a raw deflate data buffer.
I send the compressed data to an ESP32 via serial COM. To uncompress, I would like to use rom/miniz using this code in a function:
Code: Select all
tinfl_decompressor inflator;
tinfl_init(&inflator);
tinfl_status status = tinfl_decompress(&inflator, panel2, &inBufferSize, pBuffer, pBuffer, &outBufferSize, 0);
if (status != TINFL_STATUS_DONE) return false;
When I run the program, the ESP32 reboots at tinfl_decompress (no crash if I comment the 2 lines with the status).
- I have checked the transfer, the buffer is correct.
- I have tried with TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF as flag (as the destination buffer should be enough for the whole uncompressed data)
But still, it crashes.
Something I'm doing wrong? Are there any further initialisations for miniz to perform before the code above?
Thanks
David