1 --- FreeImage/Source/FreeImage/ZLibInterface.cpp Wed Mar 4 00:07:10 2015
2 +++ FreeImage/Source/FreeImage/ZLibInterface_.cpp Tue May 24 01:32:47 2022
4 // Use at your own risk!
5 // ==========================================================
7 -#include "../ZLib/zlib.h"
10 #include "Utilities.h"
11 -#include "../ZLib/zutil.h" /* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */
14 Compresses a source buffer into a target buffer, using the ZLib library.
18 // patch header, setup crc and length (stolen from mod_trace_output)
19 - BYTE *p = target + 8; *p++ = 2; *p = OS_CODE; // xflags, os_code
20 + BYTE *p = target + 8; *p++ = 2; *p = 0x03; // xflags, unix's os_code=3
21 crc = crc32(crc, source, source_size);
22 memcpy(target + 4 + dest_len, &crc, 4);
23 memcpy(target + 8 + dest_len, &source_size, 4);