… | |
… | |
157 | /* match found at *ref++ */ |
157 | /* match found at *ref++ */ |
158 | unsigned int len = 2; |
158 | unsigned int len = 2; |
159 | unsigned int maxlen = in_end - ip - len; |
159 | unsigned int maxlen = in_end - ip - len; |
160 | maxlen = maxlen > MAX_REF ? MAX_REF : maxlen; |
160 | maxlen = maxlen > MAX_REF ? MAX_REF : maxlen; |
161 | |
161 | |
162 | if (maxlen > 8) maxlen = 8;//D |
|
|
163 | |
|
|
164 | op [- lit - 1] = lit - 1; /* stop run */ |
162 | op [- lit - 1] = lit - 1; /* stop run */ |
165 | op -= !lit; /* undo run if length is zero */ |
163 | op -= !lit; /* undo run if length is zero */ |
166 | |
164 | |
167 | if (expect_false (op + 3 + 1 >= out_end)) |
165 | if (expect_false (op + 3 + 1 >= out_end)) |
168 | return 0; |
166 | return 0; |
… | |
… | |
256 | lit = 0; op++; /* start run */ |
254 | lit = 0; op++; /* start run */ |
257 | } |
255 | } |
258 | } |
256 | } |
259 | } |
257 | } |
260 | |
258 | |
261 | if (op + 2 > out_end) /* at most 2 bytes can be missing here */ |
259 | if (op + 3 > out_end) /* at most 3 bytes can be missing here */ |
262 | return 0; |
260 | return 0; |
263 | |
261 | |
264 | while (ip < in_end) |
262 | while (ip < in_end) |
265 | { |
263 | { |
266 | lit++; *op++ = *ip++; |
264 | lit++; *op++ = *ip++; |