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

[Bug]: maximum dictionary size limit needs to be increased #256

Open
1 task done
chrisgch opened this issue Oct 24, 2024 · 1 comment
Open
1 task done

[Bug]: maximum dictionary size limit needs to be increased #256

chrisgch opened this issue Oct 24, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@chrisgch
Copy link

chrisgch commented Oct 24, 2024

bit7z version

4.0.x, 3.2.x, 3.1.x, 3.0.x, 2.1, 2.0

Compilation options

No response

7-zip version

v23.01, v22.01, v22.00, v21.07, v21.06

7-zip shared library used

7z.dll / 7z.so

Compilers

MSVC

Compiler versions

No response

Architecture

x86_64, x86

Operating system

Windows

Operating system versions

No response

Bug description

In 7-zip 21.03 beta (2021-07-20), the maximum dictionary size for LZMA/LZMA2 compressing was increased to 4 GB (3840 MiB). See:
https://sevenzip.sourceforge.io/history.txt
Therefore in file bitabstractarchivecreator.cpp the line
constexpr auto kMaxLzmaDictionarySize = 1536 * ( 1LL << 20 ); // less than 1536 MiB
should be changed to
constexpr auto kMaxLzmaDictionarySize = 3840 * ( 1LL << 20 ); // less than 3840 MiB

Steps to reproduce

Call:
BitFileCompressor compressor{ lib, BitFormat::SevenZip };
compressor.setDictionarySize(3840*( 1LL << 20 );
results in error "Cannot set the dictionary size: Invalid dictionary size for the chosen compression method."

Expected behavior

The larger dictionary size should be passed to the 7zip library.

Relevant compilation output

No response

Code of Conduct

@rikyoz
Copy link
Owner

rikyoz commented Oct 24, 2024

Hi!
Nice catch, I completely missed that change in the changelog.
I'll update the code accordingly and release the fix in the next v4.0.9.
Thank you for pointing it out!

rikyoz added a commit that referenced this issue Oct 24, 2024
@rikyoz rikyoz added this to the v4.0.9 milestone Nov 2, 2024
rikyoz added a commit that referenced this issue Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants