diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 07:25:15 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 07:25:15 +0000 |
commit | 30614e95829d832d1bd3038109132fe56ea085da (patch) | |
tree | c613ffcab3d7ef6c3b62e47daf127a36dd88be89 | |
parent | Adding debian version 1.6-1. (diff) | |
download | lzip-30614e95829d832d1bd3038109132fe56ea085da.tar.xz lzip-30614e95829d832d1bd3038109132fe56ea085da.zip |
Merging upstream version 1.7.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 31 | ||||
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | decoder.cc | 15 | ||||
-rw-r--r-- | decoder.h | 13 | ||||
-rw-r--r-- | doc/lzip.1 | 4 | ||||
-rw-r--r-- | doc/lzip.info | 2 | ||||
-rw-r--r-- | doc/lzip.texinfo | 4 | ||||
-rw-r--r-- | doc/lziprecover.1 | 4 | ||||
-rw-r--r-- | encoder.h | 4 |
10 files changed, 33 insertions, 53 deletions
@@ -1,3 +1,8 @@ +2009-06-25 Antonio Diaz Diaz <ant_diaz@teleline.es> + + * Version 1.7 released. + * decoder.h (copy_block): Fixed memcpy overlap introduced in 1.6. + 2009-06-22 Antonio Diaz Diaz <ant_diaz@teleline.es> * Version 1.6 released. @@ -1,28 +1,5 @@ -Changes in version 1.6: +Changes in version 1.7: -Decompression time has been reduced by 17%. - -Decompression support for the "Sync Flush marker" from lzlib has been -added. - -Support for .tbz extension has been added to lzdiff and lzgrep. - -Man pages for lzdiff, lzgrep and lziprecover have been added to the -distribution. - -Memory use has been reduced to 9x if the input file is smaller than -dictionary size limit. - -Flush calls have been added to decompressor to allow partial recovery -of the uncompressed data when decompressing a corrupt file. - -The dependence of "--test" on the existence of "/dev/null" has been -removed. - -Some "bashisms" have been removed from lzdiff and lzgrep. - -Dictionary size for options "-1" to "-4" has been changed. - -A build problem with the Sun C++ compiler has been fixed. - -Lzdiff, lzgrep and lziprecover are now installed by default. +A bug, introduced in version 1.6, which prevents lzip from decompressing +some rare files has been fixed. The integrity checking code catches it, +so there is no risk of data loss. @@ -5,13 +5,13 @@ # This configure script is free software: you have unlimited permission # to copy, distribute and modify it. # -# Date of this version: 2009-06-22 +# Date of this version: 2009-06-25 invocation_name=$0 args= no_create= progname=lzip -progversion=1.6 +progversion=1.7 srctrigger=lzip.h # clear some things potentially inherited from environment. @@ -125,12 +125,11 @@ bool LZ_decoder::verify_trailer( const Pretty_print & pp ) const // 3 = trailer error, 4 = unknown marker found. int LZ_decoder::decode_member( const Pretty_print & pp ) { - unsigned int rep0 = 0; - unsigned int rep1 = 0; - unsigned int rep2 = 0; + unsigned int rep0 = 0; // rep[0-3] latest four distances + unsigned int rep1 = 0; // used for efficient coding of + unsigned int rep2 = 0; // repeated distances unsigned int rep3 = 0; State state; - uint8_t prev_byte = 0; while( true ) { @@ -139,11 +138,10 @@ int LZ_decoder::decode_member( const Pretty_print & pp ) if( range_decoder.decode_bit( bm_match[state()][pos_state] ) == 0 ) { if( state.is_char() ) - prev_byte = literal_decoder.decode( range_decoder, prev_byte ); + put_byte( literal_decoder.decode( range_decoder, get_byte( 0 ) ) ); else - prev_byte = literal_decoder.decode_matched( range_decoder, prev_byte, - get_byte( rep0 ) ); - put_byte( prev_byte ); + put_byte( literal_decoder.decode_matched( range_decoder, get_byte( 0 ), + get_byte( rep0 ) ) ); state.set_char(); } else @@ -222,7 +220,6 @@ int LZ_decoder::decode_member( const Pretty_print & pp ) state.set_match(); } copy_block( rep0, len ); - prev_byte = get_byte( 0 ); } } } @@ -21,7 +21,7 @@ class Input_buffer uint8_t * const buffer; int pos; int stream_pos; // when reached, a new block must be read - const int ides_; + const int ides_; // input file descriptor bool at_stream_end; bool read_block(); @@ -196,11 +196,11 @@ class Literal_decoder { return ( prev_byte >> ( 8 - literal_context_bits ) ); } public: - uint8_t decode( Range_decoder & range_decoder, const int prev_byte ) + uint8_t decode( Range_decoder & range_decoder, const uint8_t prev_byte ) { return range_decoder.decode_tree( bm_literal[state(prev_byte)], 8 ); } uint8_t decode_matched( Range_decoder & range_decoder, - const int prev_byte, const int match_byte ) + const uint8_t prev_byte, const uint8_t match_byte ) { return range_decoder.decode_matched( bm_literal[state(prev_byte)], match_byte ); } }; @@ -215,7 +215,7 @@ class LZ_decoder int pos; int stream_pos; // first byte not yet written to file uint32_t crc_; - const int odes_; + const int odes_; // output file descriptor Bit_model bm_match[State::states][pos_states]; Bit_model bm_rep[State::states]; @@ -249,7 +249,7 @@ class LZ_decoder { int i = pos - distance - 1; if( i < 0 ) i += buffer_size; - if( len < buffer_size - std::max( pos, i ) && len <= distance ) + if( len < buffer_size - std::max( pos, i ) && len <= std::abs( pos - i ) ) { std::memcpy( buffer + pos, buffer + i, len ); pos += len; @@ -278,7 +278,8 @@ public: crc_( 0xFFFFFFFF ), odes_( odes ), range_decoder( sizeof header, ibuf ), - literal_decoder() {} + literal_decoder() + { buffer[buffer_size-1] = 0; } // prev_byte of first_byte ~LZ_decoder() { delete[] buffer; } @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH LZIP "1" "June 2009" "Lzip 1.6" "User Commands" +.TH LZIP "1" "June 2009" "Lzip 1.7" "User Commands" .SH NAME -Lzip \- manual page for Lzip 1.6 +Lzip \- manual page for Lzip 1.7 .SH SYNOPSIS .B lzip [\fIoptions\fR] [\fIfiles\fR] diff --git a/doc/lzip.info b/doc/lzip.info index 342940b..31080a8 100644 --- a/doc/lzip.info +++ b/doc/lzip.info @@ -11,7 +11,7 @@ File: lzip.info, Node: Top, Next: Introduction, Up: (dir) Lzip **** -This manual is for Lzip (version 1.6, 22 June 2009). +This manual is for Lzip (version 1.7, 25 June 2009). * Menu: diff --git a/doc/lzip.texinfo b/doc/lzip.texinfo index de1f2ad..a17cded 100644 --- a/doc/lzip.texinfo +++ b/doc/lzip.texinfo @@ -5,8 +5,8 @@ @finalout @c %**end of header -@set UPDATED 22 June 2009 -@set VERSION 1.6 +@set UPDATED 25 June 2009 +@set VERSION 1.7 @dircategory Data Compression @direntry diff --git a/doc/lziprecover.1 b/doc/lziprecover.1 index 6173847..37c2ac2 100644 --- a/doc/lziprecover.1 +++ b/doc/lziprecover.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH LZIPRECOVER "1" "June 2009" "Lziprecover 1.6" "User Commands" +.TH LZIPRECOVER "1" "June 2009" "Lziprecover 1.7" "User Commands" .SH NAME -Lziprecover \- manual page for Lziprecover 1.6 +Lziprecover \- manual page for Lziprecover 1.7 .SH SYNOPSIS .B lziprecover [\fIoptions\fR] \fIfile\fR @@ -150,7 +150,7 @@ class Matchfinder int cyclic_pos; int stream_pos; // first byte not yet read from file int pos_limit; // when reached, a new block must be read - const int ides_; + const int ides_; // input file descriptor const int match_len_limit_; int32_t * const prev_positions; // last seen position of key int32_t * prev_pos_tree; @@ -206,7 +206,7 @@ class Range_encoder int pos; uint32_t range; int ff_count; - const int odes_; + const int odes_; // output file descriptor uint8_t cache; void shift_low() |