what destination buffer size should I use for LzmaEncode?
I found on the web
destLen = srcLen + srcLen/3 + 128;
This is far too large and wasting memory, if I can rely on my tests encoding random data.
For props.dictSize I choose a value near the source data length, is this a good choice?
@Igor: Thank you for providing the LZMA code.
In most cases
srcLen + srcLen/40 + (1 << 12)
But if some "BAD_data" attack is possible, you must support
bigger buffer. I suppose that
srcLen + srcLen/5 + (1 << 16).
is OK for any data.
Thank you for your quick reply!
Log in to post a comment.