| Line 33... |
Line 33... |
| 33 |
&& *in_pos == in_size)
|
33 |
&& *in_pos == in_size)
|
| 34 |
coder->end_was_reached = true;
|
34 |
coder->end_was_reached = true;
|
| 35 |
|
35 |
|
| 36 |
} else {
|
36 |
} else {
|
| 37 |
// Call the next coder in the chain to provide us some data.
|
37 |
// Call the next coder in the chain to provide us some data.
|
| 38 |
// We don't care about uncompressed_size here, because
|
- |
|
| 39 |
// the next filter in the chain will do it for us (since
|
- |
|
| 40 |
// we don't change the size of the data).
|
- |
|
| 41 |
const lzma_ret ret = coder->next.code(
|
38 |
const lzma_ret ret = coder->next.code(
|
| 42 |
coder->next.coder, allocator,
|
39 |
coder->next.coder, allocator,
|
| 43 |
in, in_pos, in_size,
|
40 |
in, in_pos, in_size,
|
| 44 |
out, out_pos, out_size, action);
|
41 |
out, out_pos, out_size, action);
|
| 45 |
|
42 |
|
| Line 108... |
Line 105... |
| 108 |
// more data to out[] hopefully filling it completely. Then filter
|
105 |
// more data to out[] hopefully filling it completely. Then filter
|
| 109 |
// the data in out[]. This step is where most of the data gets
|
106 |
// the data in out[]. This step is where most of the data gets
|
| 110 |
// filtered if the buffer sizes used by the application are reasonable.
|
107 |
// filtered if the buffer sizes used by the application are reasonable.
|
| 111 |
const size_t out_avail = out_size - *out_pos;
|
108 |
const size_t out_avail = out_size - *out_pos;
|
| 112 |
const size_t buf_avail = coder->size - coder->pos;
|
109 |
const size_t buf_avail = coder->size - coder->pos;
|
| 113 |
if (out_avail > buf_avail) {
|
110 |
if (out_avail > buf_avail || buf_avail == 0) {
|
| 114 |
// Store the old position so that we know from which byte
|
111 |
// Store the old position so that we know from which byte
|
| 115 |
// to start filtering.
|
112 |
// to start filtering.
|
| 116 |
const size_t out_start = *out_pos;
|
113 |
const size_t out_start = *out_pos;
|
| 117 |
|
114 |
|
| 118 |
// Flush data from coder->buffer[] to out[], but don't reset
|
115 |
// Flush data from coder->buffer[] to out[], but don't reset
|