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

fixing regression introduced in 595e589099ac3d945f53b0a737f590f748ac99e4 #2

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

oaken-source
Copy link

Commit 595e589 has introduced a regression where numerous NUL bytes were introduced in the output stream of the decompressed files.

This was because the array slice assignment was not equivalent to the loop item assignments when the array ranges were overlapping. reverting that change fixes the output.

Verified by running the following code:

import mpyq

archive = mpyq.MPQArchive('d2data.mpq') # from a fresh install of Diablo II LoD 1.14d
f = [f for f in archive.files if 'misc.txt' in f.decode('ascii')][0]

with open('misc.txt', 'wb') as o:
    o.write(archive.read_file(f))

@TheSil TheSil merged commit 2a61650 into TheSil:master Oct 26, 2024
@TheSil
Copy link
Owner

TheSil commented Oct 26, 2024

I don't remember getting any notification of this one - well it's merged, I guess better late than newer. Thanks.

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