mirror of
				https://github.com/eledio-devices/thirdparty-miniz.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -3131,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_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE]; | ||||||
|     mz_uint16 bit_flags = 0; |     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))) |     if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))) | ||||||
|         bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; |         bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; | ||||||
|  |  | ||||||
|     if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME)) |     if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME)) | ||||||
|         bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8; |         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; |     level = level_and_flags & 0xF; | ||||||
|     store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)); |     store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user