1
0
mirror of synced 2024-11-27 17:10:51 +01:00
ImHex/plugins
paxcut 0b2eca3066
fix: LZMA decompressor memory errors (#1873)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### 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.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:20:17 +02:00
..
builtin feat: Added underwaved text functions (#1889) 2024-09-15 15:19:04 +02:00
decompress fix: LZMA decompressor memory errors (#1873) 2024-09-15 15:20:17 +02:00
diffing lang: Update Chinese (Simplified) translations (#1894) 2024-09-15 15:17:25 +02:00
disassembler fix: Task names not displaying correctly anymore 2024-07-27 14:09:52 +02:00
fonts fix: Crash on exit when using custom font from file (#1815) 2024-07-15 22:22:02 +02:00
hashes fix: Segfault when hashing regions spanning multiple MiBs (#1804) 2024-07-21 20:35:38 +02:00
script_loader lang: Update Chinese (Simplified) translations (#1894) 2024-09-15 15:17:25 +02:00
ui lang: Update Chinese (Simplified) translations (#1894) 2024-09-15 15:17:25 +02:00
visualizers fix: Avoid crashing ImHex when passing invalid data to the 3D visualizer (#1874) 2024-09-15 15:19:41 +02:00
windows lang: Update Chinese (Simplified) translations (#1894) 2024-09-15 15:17:25 +02:00
yara_rules fix: Task names not displaying correctly anymore 2024-07-27 14:09:52 +02:00