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

Non zip compression format detection doesn't seem to work (with fix) #45

Open
Levoila opened this issue Mar 6, 2020 · 2 comments
Open

Comments

@Levoila
Copy link

Levoila commented Mar 6, 2020

Hi,

I had a 7z file to extract but SevenZipExtractor::DetectCompressionFormat would think that the format was CompressionFormat::Lzma86 instead of CompressionFormat::SevenZip.

The format is detected is by trying to open the archive with each type consecutively until the archive opens correctly (link to source) but the file is not seeked to the beginning after each iteration, seemingly leading to no/incorrect detection for all but zip formats.

Seeking the file to the beginning before each iteration with fileStream->Seek({}, STREAM_SEEK_SET, nullptr); seems to fix the issue.

@getnamo
Copy link
Owner

getnamo commented Mar 6, 2020

Interesting catch, seems like you know where to place the fix, if you make a pull request I'll merge it :)

@getnamo
Copy link
Owner

getnamo commented Mar 9, 2020

merged #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants