fix : HC streaming mode
This commit is contained in:
parent
17fdc54813
commit
7ac18ad9dc
1
NEWS
1
NEWS
@ -1,5 +1,6 @@
|
||||
r121:
|
||||
Added : Makefile : install for kFreeBSD and Hurd (Nobuhiro Iwamatsu)
|
||||
Fix : Makefile : install for OS-X and BSD, thanks to Takayuki Matsuoka
|
||||
|
||||
r120:
|
||||
Modified : Streaming API, using strong types
|
||||
|
5
lz4hc.c
5
lz4hc.c
@ -400,7 +400,10 @@ FORCE_INLINE void LZ4HC_Insert (LZ4HC_Data_Structure* hc4, const BYTE* ip)
|
||||
char* LZ4_slideInputBufferHC(void* LZ4HC_Data)
|
||||
{
|
||||
LZ4HC_Data_Structure* hc4 = (LZ4HC_Data_Structure*)LZ4HC_Data;
|
||||
U32 distance = (U32)(hc4->end - hc4->inputBuffer) - 64 KB;
|
||||
size_t distance = (hc4->end - 64 KB) - hc4->inputBuffer;
|
||||
|
||||
if (hc4->end <= hc4->inputBuffer + 64 KB) return (char*)(hc4->end); /* no update : less than 64KB within buffer */
|
||||
|
||||
distance = (distance >> 16) << 16; /* Must be a multiple of 64 KB */
|
||||
LZ4HC_Insert(hc4, hc4->end - MINMATCH);
|
||||
memcpy((void*)(hc4->end - 64 KB - distance), (const void*)(hc4->end - 64 KB), 64 KB);
|
||||
|
Loading…
Reference in New Issue
Block a user