summaryrefslogtreecommitdiffstats
path: root/decoder.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 13:34:37 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 13:34:37 +0000
commitf8840edb77f083c1d3a653bb4edb0490d53eab2c (patch)
tree58a545983dd1903ff2d42afd35d1d60c989c5ccf /decoder.cc
parentAdding debian version 0.4-1. (diff)
downloadlzlib-f8840edb77f083c1d3a653bb4edb0490d53eab2c.tar.xz
lzlib-f8840edb77f083c1d3a653bb4edb0490d53eab2c.zip
Merging upstream version 0.5.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'decoder.cc')
-rw-r--r--decoder.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/decoder.cc b/decoder.cc
index f68edf9..b426b3e 100644
--- a/decoder.cc
+++ b/decoder.cc
@@ -130,12 +130,12 @@ int LZ_decoder::decode_member()
const int pos_state = data_position() & pos_state_mask;
if( range_decoder.decode_bit( bm_match[state()][pos_state] ) == 0 )
{
+ const uint8_t prev_byte = get_byte( 0 );
if( state.is_char() )
- prev_byte = literal_decoder.decode( range_decoder, prev_byte );
+ put_byte( literal_decoder.decode( range_decoder, prev_byte ) );
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, prev_byte,
+ get_byte( rep0 ) ) );
state.set_char();
}
else
@@ -209,7 +209,6 @@ int LZ_decoder::decode_member()
state.set_match();
}
copy_block( rep0, len );
- prev_byte = get_byte( 0 );
}
}
}