Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the lzma decoder seems to always fail with a memory error #1873

Merged
merged 3 commits into from
Sep 15, 2024

Conversation

paxcut
Copy link
Contributor

@paxcut paxcut commented Aug 25, 2024

Problem description

I was unable to use the LZMA de-compressor even though 7zip was able to identify them as LZMA compressed and decompress them without a problem. Under the debugger the lzma_code() call was returning LZMA_MEMLIMIT_ERROR.

Implementation description

I found online that the error can be fixed using lzma_memlimit_set() using a value obtained with lzma_memusage(). I tried to avoid having to call lzma_code() twice but if the functions are called before the first lzma_code()the values of memory obtained fall short and error occurs again.

I suspect that there are better ways to deal with this other than the code proposed in this PR, but I haven't been able to find any.

paxcut and others added 3 commits August 25, 2024 15:28
I was unable to use the lzma decompressor even though 7zip was able to identify them as lzma compressed and decompress them without a problem. Under the debugger the lzma_code() call was returning `LZMA_MEMLIMIT_ERROR`.

I found online that the error can be fixed using `lzma_memlimit_set()` using a value obtained with `lzma_memusage()`. I tried to avoid having to call `lzma_code()` twice but if the functions are called before the first `lzma_code()`the values of memory obtained fall short and error occurs again.

I suspect that there are better ways to deal with this other than the code proposed in this PR, but I haven't been able to find any.
@WerWolv WerWolv merged commit 0b2eca3 into WerWolv:master Sep 15, 2024
15 checks passed
@paxcut paxcut deleted the LZMAMemError branch September 17, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants