diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-14 12:08:02 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-14 12:08:02 +0200 |
commit | 3e09e1c05871f3757f759b801890ccccc9286608 (patch) | |
tree | 37d394a89c6d7377a68d8980c8bd198769461785 /src | |
parent | Small LZMA_SYNC_FLUSH fixes to Block and Single-Stream encoders. (diff) | |
download | xz-3e09e1c05871f3757f759b801890ccccc9286608.tar.xz |
In lzma_read_match_distances(), don't use
coder->lz.stream_end_was_reached. That variable
will be removed, and the check isn't required anyway.
Rearrange the check so that it doesn't make one to
think that there could be an integer overflow.
Diffstat (limited to 'src')
-rw-r--r-- | src/liblzma/lzma/lzma_encoder_private.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liblzma/lzma/lzma_encoder_private.h b/src/liblzma/lzma/lzma_encoder_private.h index 7fb1566a..9ecbc1c5 100644 --- a/src/liblzma/lzma/lzma_encoder_private.h +++ b/src/liblzma/lzma/lzma_encoder_private.h @@ -197,12 +197,12 @@ lzma_read_match_distances(lzma_coder *coder, uint32_t limit = MATCH_MAX_LEN - *len_res; assert(offset + limit < coder->lz.keep_size_after); + assert(coder->lz.read_pos <= coder->lz.write_pos); // If we are close to end of the stream, we may need // to limit the length of the match. - if (coder->lz.stream_end_was_reached - && coder->lz.write_pos - < coder->lz.read_pos + offset + limit) + if (coder->lz.write_pos - coder->lz.read_pos + < offset + limit) limit = coder->lz.write_pos - (coder->lz.read_pos + offset); |