diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-06 11:40:25 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-06 11:40:25 +0000 |
commit | 90cd6e9b8b41a5418b87ab3f4832fdcc3cf2c3f5 (patch) | |
tree | a728c7e31e9a10563bdf13b21214f69e9d575f04 /decoder.c | |
parent | Adding debian version 1.5~rc1-1. (diff) | |
download | clzip-90cd6e9b8b41a5418b87ab3f4832fdcc3cf2c3f5.tar.xz clzip-90cd6e9b8b41a5418b87ab3f4832fdcc3cf2c3f5.zip |
Merging upstream version 1.5.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r-- | decoder.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -104,9 +104,9 @@ bool Rd_read_block( struct Range_decoder * const rdec ) void LZd_flush_data( struct LZ_decoder * const decoder ) { - const int size = decoder->pos - decoder->stream_pos; - if( size > 0 ) + if( decoder->pos > decoder->stream_pos ) { + const int size = decoder->pos - decoder->stream_pos; CRC32_update_buf( &decoder->crc, decoder->buffer + decoder->stream_pos, size ); if( decoder->outfd >= 0 && writeblock( decoder->outfd, decoder->buffer + decoder->stream_pos, size ) != size ) @@ -223,9 +223,9 @@ int LZd_decode_member( struct LZ_decoder * const decoder, else { int len; - if( Rd_decode_bit( rdec, &decoder->bm_rep[state] ) == 1 ) /* 2nd bit */ + if( Rd_decode_bit( rdec, &decoder->bm_rep[state] ) != 0 ) /* 2nd bit */ { - if( Rd_decode_bit( rdec, &decoder->bm_rep0[state] ) == 1 ) /* 3rd bit */ + if( Rd_decode_bit( rdec, &decoder->bm_rep0[state] ) != 0 ) /* 3rd bit */ { unsigned distance; if( Rd_decode_bit( rdec, &decoder->bm_rep1[state] ) == 0 ) /* 4th bit */ @@ -255,7 +255,7 @@ int LZd_decode_member( struct LZ_decoder * const decoder, int dis_slot; const unsigned rep0_saved = rep0; len = min_match_len + Rd_decode_len( rdec, &decoder->match_len_model, pos_state ); - dis_slot = Rd_decode_tree6( rdec, decoder->bm_dis_slot[get_dis_state(len)] ); + dis_slot = Rd_decode_tree6( rdec, decoder->bm_dis_slot[get_len_state(len)] ); if( dis_slot < start_dis_model ) rep0 = dis_slot; else { |