diff options
author | root <root> | 2007-11-30 10:34:26 +0000 |
---|---|---|
committer | root <root> | 2007-11-30 10:34:26 +0000 |
commit | 8342db96e5793b93361032f731defdb8e6f49dcc (patch) | |
tree | 5dfce36c6de1eae5147fbd2284e1a2340e8b2d88 /lzf_c.c | |
parent | c72a1f9f4f367ca86b78a29280d61ccf76b9a3f5 (diff) |
*** empty log message ***
Diffstat (limited to 'lzf_c.c')
-rw-r--r-- | lzf_c.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -159,6 +159,8 @@ lzf_compress (const void *const in_data, unsigned int in_len, unsigned int maxlen = in_end - ip - len; maxlen = maxlen > MAX_REF ? MAX_REF : maxlen; + if (maxlen > 8) maxlen = 8;//D + op [- lit - 1] = lit - 1; /* stop run */ op -= !lit; /* undo run if length is zero */ @@ -262,6 +264,12 @@ lzf_compress (const void *const in_data, unsigned int in_len, while (ip < in_end) { lit++; *op++ = *ip++; + + if (expect_false (lit == MAX_LIT)) + { + op [- lit - 1] = lit - 1; /* stop run */ + lit = 0; op++; /* start run */ + } } op [- lit - 1] = lit - 1; /* end run */ |