15 Commits
2.0.6 ... 2.0.7

Author SHA1 Message Date
Martin
36b6c99f62 Incremented version 2018-02-20 19:03:53 +01:00
Martin
04f2169b8a Incremented version 2018-02-20 19:02:57 +01:00
Martin
14a5a1397b Merge branch 'master' of github.com:uroni/miniz 2018-02-20 19:00:19 +01:00
Martin
fef12d34f1 Remove _LARGEFILE64_SOURCE requirement from apple defines for large files 2018-02-20 18:58:32 +01:00
Martin Raiber
b01930542e Merge pull request #83 from arteniioleg/master
install library and headers
2017-11-30 12:52:09 +01:00
Martin Raiber
9c88e826a2 Merge pull request #82 from JonnyH/WIP/fix-default-level-mz_zip_writer_add_mem
Fix assert with mz_zip_writer_add_mem* w/MZ_DEFAULT_COMPRESSION
2017-11-30 12:51:58 +01:00
arteniioleg
22e4ef1b1d install library and headers 2017-11-23 14:25:55 +02: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
Martin Raiber
c17cc20c80 Merge pull request #3 from lockie/master
CMake improvements
2017-10-17 23:36:08 +02:00
Martin Raiber
0f6b199e5b Merge pull request #78 from coyote1357/master
Fix resource leak in mz_zip_reader_init_file_v2
2017-10-17 23:33:40 +02: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
Martin Raiber
aadc405b1c Merge pull request #76 from jasonrohrer/master
Fixed loads of uninitilized value errors found with Valgrind by memse…
2017-09-02 16:17:53 +02:00
Jason Rohrer
02c51d3662 Fixed loads of uninitilized value errors found with Valgrind by memsetting m_dict to 0 in tdefl_init. 2017-08-28 18:28:14 -07:00
Andrew Kravchuk
9393a95f26 Removed need in C++ compiler in cmake build 2017-08-26 03:47:07 +03:00
Andrew Kravchuk
82e5b184e4 Fixed CMAKE_BUILD_TYPE default value 2017-08-26 00:03:50 +03:00
4 changed files with 28 additions and 10 deletions

View File

@@ -1,7 +1,12 @@
PROJECT(miniz)
PROJECT(miniz C)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
if(CMAKE_BUILD_TYPE STREQUAL "")
# CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
# differentiation between debug and release builds.
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: None (CMAKE_CXX_FLAGS or \
CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
@@ -38,3 +43,10 @@ endif()
# add_executable(miniz_tester ${MINIZ_TESTER_SRC_LIST})
# target_link_libraries(miniz_tester miniz)
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
file(GLOB INSTALL_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
install(FILES ${INSTALL_HEADERS} DESTINATION include/${PROJECT_NAME})

View File

@@ -1,4 +1,4 @@
/* miniz.c 2.0.6 beta - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
/* miniz.c 2.0.7 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
See "unlicense" statement at the end of this file.
Rich Geldreich <richgel99@gmail.com>, last updated Oct. 13, 2013
Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt
@@ -234,11 +234,11 @@ enum
MZ_DEFAULT_COMPRESSION = -1
};
#define MZ_VERSION "10.0.1"
#define MZ_VERNUM 0xA010
#define MZ_VERSION "10.0.2"
#define MZ_VERNUM 0xA020
#define MZ_VER_MAJOR 10
#define MZ_VER_MINOR 0
#define MZ_VER_REVISION 1
#define MZ_VER_REVISION 2
#define MZ_VER_SUBREVISION 0
#ifndef MINIZ_NO_ZLIB_APIS

View File

@@ -1334,6 +1334,8 @@ tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_fun
d->m_pSrc = NULL;
d->m_src_buf_left = 0;
d->m_out_buf_ofs = 0;
if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
MZ_CLEAR_OBJ(d->m_dict);
memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0);
memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1);
return TDEFL_STATUS_OKAY;

View File

@@ -112,7 +112,7 @@ static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream)
#define MZ_FFLUSH fflush
#define MZ_FREOPEN(p, m, s) freopen64(p, m, s)
#define MZ_DELETE_FILE remove
#elif defined(__APPLE__) && _LARGEFILE64_SOURCE
#elif defined(__APPLE__)
#ifndef MINIZ_NO_TIME
#include <utime.h>
#endif
@@ -978,7 +978,10 @@ mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename,
/* TODO: Better sanity check archive_size and the # of actual remaining bytes */
if (file_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
{
MZ_FCLOSE(pFile);
return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
}
if (!mz_zip_reader_init_internal(pZip, flags))
{
@@ -3128,14 +3131,15 @@ mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_n
mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
mz_uint16 bit_flags = 0;
if ((int)level_and_flags < 0)
level_and_flags = MZ_DEFAULT_LEVEL;
if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;
if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;
if ((int)level_and_flags < 0)
level_and_flags = MZ_DEFAULT_LEVEL;
level = level_and_flags & 0xF;
store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA));