Skip to content

Commit

Permalink
Merging another reasonably important bugfix in mz_zip_reader_extract_…
Browse files Browse the repository at this point in the history
…to_mem_no_alloc() into v1.15
  • Loading branch information
[email protected] committed Oct 13, 2013
1 parent fe5340a commit 2d8997f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion miniz.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Critical fix for the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks [email protected]) which could cause locate files to not find files. This bug
would only have occured in earlier versions if you explicitly used this flag, OR if you used mz_zip_extract_archive_file_to_heap() or mz_zip_add_mem_to_archive_file_in_place()
(which used this flag). If you can't switch to v1.15 but want to fix this bug, just remove the uses of this flag from both helper funcs (and of course don't use the flag).
- Bugfix in mz_zip_reader_extract_to_mem_no_alloc() from kymoon when pUser_read_buf is not NULL and compressed size is > uncompressed size
- Fixing mz_zip_reader_extract_*() funcs so they don't try to extract compressed data from directory entries, to account for weird zipfiles which contain zero-size compressed data on dir entries.
Hopefully this fix won't cause any issues on weird zip archives, because it assumes the low 16-bits of zip external attributes are DOS attributes (which I believe they always are in practice).
- Fixing mz_zip_reader_is_file_a_directory() so it doesn't check the internal attributes, just the filename and external attributes
Expand Down Expand Up @@ -3606,7 +3607,7 @@ mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file
pRead_buf = (mz_uint8 *)pUser_read_buf;
read_buf_size = user_read_buf_size;
read_buf_avail = 0;
comp_remaining = file_stat.m_uncomp_size;
comp_remaining = file_stat.m_comp_size;
}
else
{
Expand Down

0 comments on commit 2d8997f

Please sign in to comment.