63 Commits

Author SHA1 Message Date
Ozkan Sezer
e285002431 replace use of stdint.h types with mz_ variants 2022-02-09 09:36:50 +03:00
Martin Raiber
f3d9e2293b Fix return value 2022-01-22 22:14:31 +01:00
Ozkan Sezer
501a761549 miniz_zip: fix mz_zip_reader_extract_to_heap to read correct sizes
Fixes: https://github.com/richgel999/miniz/issues/218
2022-01-02 20:56:56 +03:00
Martin
13b21dddc7 Remove total files check (its 32-bit uint)
This fixes a compiler warning. The check didn't do
anything since m_total_files is a 32-bit uint and
MZ_UINT32_MAX is actually a valid value.
2021-12-11 12:59:21 +01:00
Martin
a956b4c753 Fix MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8 not being set 2021-12-11 12:51:50 +01:00
Martin
72e7267054 Fix unaligned pointer access 2021-11-28 18:37:55 +01:00
Martin
3e5e488ba9 Use level_and_flags after MZ_DEFAULT_COMPRESSION has been handled 2021-11-28 18:08:27 +01:00
Martin
ee4deb08fa Merge remote-tracking branch 'ccawley2011/mingw-watcom'
# Conflicts:
#	examples/example6.c
2021-11-11 21:36:15 +01:00
Ellie
cda0b3e7f0 Fix MinGW cross compilation by removing unneeded capitalization 2021-11-11 13:38:57 +01:00
Zsombor Fazekas
d9c899cea4 Use _wstat64 instead _stat64 on windows 2021-09-16 12:12:07 +02:00
Zsombor Fazekas
70c79cc9d5 Use wfopen on windows 2021-09-16 12:00:44 +02:00
Cameron Cawley
78ae375016 Fix "'&array' may not produce intended result" warnings with OpenWatcom
Co-authored-by: sezero <sezero@users.noreply.github.com>
2021-07-20 18:08:11 +01:00
Cameron Cawley
f542e6df73 Fix "Comparison result always 0" warnings with OpenWatcom 2021-07-20 18:05:16 +01:00
Cameron Cawley
c0aad72d46 Use _ftelli64, _fseeki64 and stat with MinGW32 and OpenWatcom 2021-07-20 18:04:52 +01:00
Martin
75744d32d4 Add flag to set (compressed) size in local file header 2021-02-08 13:49:57 +01:00
Martin Raiber
b43f8a0c22 Merge pull request #147 from andiwand/write-with-dynamic-size
write with dynamic size
2021-02-07 22:03:46 +01:00
Martin Raiber
17d6763721 Merge pull request #154 from wdconinc/patch-1
Fix unused parameter ‘pArray’ in mz_zip_array_range_check
2021-02-07 21:41:07 +01:00
Randy
f52e09a208 mz_zip_validate_file(): fix memory leak on errors
https://oss-fuzz.com/testcase?key=5744008051294208
2020-11-26 02:21:57 +01:00
Wouter Deconinck
fa09b1f3d4 Fix unused parameter ‘pArray’ in mz_zip_array_range_check
When NDEBUG, the assert in mz_zip_array_range_check does nothing and an unused variable warning is generated at 4159f8c8c3/miniz_zip.c (L280)

This commit removes the `|| define (NDEBUG)` so when debugging is turned off, no range check is performed.
2020-04-20 11:19:09 -05:00
Andreas Stefl
1e8c7ce810 write with dynamic size 2020-01-23 17:15:04 +01:00
Syoyo Fujita
a828cc329c ansi mode does not support double-slash comment. Replaced // with /* */ 2019-12-26 14:53:37 +09:00
Your Name
a88d1571c1 Fix missing crc guard
This fixes a warning for an unused variable if `MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS` is on.
2019-12-13 11:22:05 -08:00
Anthony Rabine
5108f95f58 Fix warning (added cast) 2019-10-28 13:50:42 +01:00
Daniel d'Andrada
334e0d64ce Fix LFS check
Code should check for__USE_LARGEFILE64, not _LARGEFILE64_SOURCE

_LARGEFILE64_SOURCE should be used only for setting a preference
when compiling code (either explicitly or by the compiler itself).
Then, according to its value, features.h will take care define things
like __USE_LARGEFILE64 appropriately.

As a side-effect, this patch adds support for clang. When building
with clang one has to explicitly define _LARGEFILE64_SOURCE if he
want to use the *64 api.
2019-10-04 14:11:18 +02:00
tamasmeszaros
d57872c77a Fix for older cmake versions and build of examples. 2019-06-03 10:02:13 +02:00
Martin
a4264837ae Fix type issue 2019-04-11 02:35:18 +02:00
Martin
25de35faec Remove check that path of file added to archive contains ':' or '\' 2019-03-07 14:37:56 +01:00
Martin
4d1d5b6771 Merge branch 'master' of github.com:richgel999/miniz 2019-03-07 14:08:22 +01:00
Martin Raiber
034f0228eb Merge pull request #122 from FrancescAlted/fix-msvc-warning2
More fixes for warnings MSVC
2019-03-07 14:06:42 +01:00
Martin
6db3c0d290 Don't warn if _LARGEFILE64_SOURCE is not defined 2019-03-07 14:04:15 +01:00
Francesc Alted
96f0da1db9 Yet another fix 2019-03-06 14:34:39 +01:00
Francesc Alted
93c6567773 More fixes for MSVC 2019-03-06 14:07:45 +01:00
Francesc Alted
2b45f89867 Fix a MSVC 2013 warning 2019-03-06 09:51:03 +01:00
paul
45a080c050 Fix large file support under Windows
Under Windows _stat maps to _stat64i32 which only supports max int32_t file sizes.
Change to _stat64 which uses 64bit file sizes and file modification times.
2019-01-23 12:36:25 +10:00
Zach DeVito
a3ca94f833 guard memcpy when n == 0 because buffer may be NULL 2018-11-29 16:56:13 -08:00
Martin
9ce0d0ddff Fix out of bounds read while reading Zip64 extended information 2018-11-11 19:11:47 +01:00
Martin
306edd2022 New function to read files via callback functions when adding them 2018-11-11 19:10:35 +01:00
Martin
46cdde2ac5 Fix corrupt archive if uncompressed file smaller than 4 byte and file is added by mz_zip_writer_add_mem* 2018-07-10 22:31:13 +02:00
Martin
fef12d34f1 Remove _LARGEFILE64_SOURCE requirement from apple defines for large files 2018-02-20 18:58:32 +01:00
Jonathan Hamilton
7a7d0b423b Fix assert with mz_zip_writer_add_mem* w/MZ_DEFAULT_COMPRESSION
Issue #81

As MZ_DEFAULT_COMPRESSION is set as "-1", one of the bits is incorrectly
interpreted as the "MZ_ZIP_FLAG_COMPRESSED_DATA" flag before the check
for (flags < 0) intended to catch the MZ_DEFAULT_COMPRESION case.

This would then cause an assert() to be hit on any calls where the
uncomp_size is non-zero.

Moving the "Default" level check above any other flag checks should
solve this issue.
2017-11-23 00:22:24 -08:00
T. Isaac Lightburn
0b7d3070b9 Fix resource leak in mz_zip_reader_init_file_v2
Was returning on error without closing file.
2017-10-12 21:29:43 -05:00
Phil Greenland
0d13890f4b Add "iterative" file extraction method based on mz_zip_reader_extract_to_callback. 2017-05-14 11:54:29 +01:00
Martin
149b34c254 Remove check for cur_archive_file_ofs > UINT_MAX, because cur_archive_file_ofs is not used after this point 2017-04-24 17:28:20 +02:00
Michał Janiszewski
a6a989cc18 clang-format the sources 2017-03-23 08:50:08 +01:00
Michał Janiszewski
3c7177c0cb Fix misleading indentation 2017-03-23 08:38:10 +01:00
Martin
1c6ca868d7 Fix compilation with the various omission compile definitions 2017-03-13 19:38:42 +01:00
Martin
e72ae3f4c2 Use UTF-8 for filenames in ZIP files per default 2017-03-11 18:24:44 +01:00
Martin
91ce90fa17 Added callback for periodic flushes 2017-02-08 15:53:52 +01:00
Martin
a7e7e92a20 Fix compile warnings 2017-01-19 15:57:04 +01:00
Martin
3b7ee5aea5 Fix compile warnings 2017-01-19 15:53:53 +01:00