summaryrefslogtreecommitdiffstats
path: root/decoder.c
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-06 11:39:32 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-06 11:39:32 +0000
commitb54746257408488a8d0b5c86f1c0ab9a66047ed4 (patch)
tree43affae2aaf3a28479a3271daafa33267269dd21 /decoder.c
parentAdding upstream version 1.5~pre2. (diff)
downloadclzip-b54746257408488a8d0b5c86f1c0ab9a66047ed4.tar.xz
clzip-b54746257408488a8d0b5c86f1c0ab9a66047ed4.zip
Adding upstream version 1.5~rc1.upstream/1.5_rc1
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'decoder.c')
-rw-r--r--decoder.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/decoder.c b/decoder.c
index d1df32f..9c31677 100644
--- a/decoder.c
+++ b/decoder.c
@@ -225,13 +225,7 @@ int LZd_decode_member( struct LZ_decoder * const decoder,
int len;
if( Rd_decode_bit( rdec, &decoder->bm_rep[state] ) == 1 ) /* 2nd bit */
{
- if( Rd_decode_bit( rdec, &decoder->bm_rep0[state] ) == 0 ) /* 3rd bit */
- {
- if( Rd_decode_bit( rdec, &decoder->bm_len[state][pos_state] ) == 0 ) /* 4th bit */
- { state = St_set_short_rep( state );
- LZd_put_byte( decoder, LZd_get_byte( decoder, rep0 ) ); continue; }
- }
- else
+ if( Rd_decode_bit( rdec, &decoder->bm_rep0[state] ) == 1 ) /* 3rd bit */
{
unsigned distance;
if( Rd_decode_bit( rdec, &decoder->bm_rep1[state] ) == 0 ) /* 4th bit */
@@ -247,6 +241,12 @@ int LZd_decode_member( struct LZ_decoder * const decoder,
rep1 = rep0;
rep0 = distance;
}
+ else
+ {
+ if( Rd_decode_bit( rdec, &decoder->bm_len[state][pos_state] ) == 0 ) /* 4th bit */
+ { state = St_set_short_rep( state );
+ LZd_put_byte( decoder, LZd_get_byte( decoder, rep0 ) ); continue; }
+ }
state = St_set_rep( state );
len = min_match_len + Rd_decode_len( rdec, &decoder->rep_len_model, pos_state );
}