summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog5
-rw-r--r--NEWS31
-rwxr-xr-xconfigure4
-rw-r--r--decoder.cc15
-rw-r--r--decoder.h13
-rw-r--r--doc/lzip.14
-rw-r--r--doc/lzip.info2
-rw-r--r--doc/lzip.texinfo4
-rw-r--r--doc/lziprecover.14
-rw-r--r--encoder.h4
10 files changed, 33 insertions, 53 deletions
diff --git a/ChangeLog b/ChangeLog
index de24425..e1f1f7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/NEWS b/NEWS
index 26f2f60..9675db1 100644
--- a/NEWS
+++ b/NEWS
@@ -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.
diff --git a/configure b/configure
index 7ca05a6..23213cc 100755
--- a/configure
+++ b/configure
@@ -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.
diff --git a/decoder.cc b/decoder.cc
index 0cb6188..6c0c775 100644
--- a/decoder.cc
+++ b/decoder.cc
@@ -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 );
}
}
}
diff --git a/decoder.h b/decoder.h
index 290ab97..e4444f1 100644
--- a/decoder.h
+++ b/decoder.h
@@ -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; }
diff --git a/doc/lzip.1 b/doc/lzip.1
index 46661ef..41c6381 100644
--- a/doc/lzip.1
+++ b/doc/lzip.1
@@ -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
diff --git a/encoder.h b/encoder.h
index fe44e71..6433526 100644
--- a/encoder.h
+++ b/encoder.h
@@ -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()