]> wimlib.net Git - wimlib/blobdiff - src/xpress-decompress.c
Add ax_pthread.m4
[wimlib] / src / xpress-decompress.c
index bf42c1f0a69883845dab935c929b4ea7b3a80dfc..b43e5273e75a006e99ba5b5df8b9fe2a2274faba 100644 (file)
@@ -8,20 +8,18 @@
  *
  * Copyright (C) 2012, 2013 Eric Biggers
  *
- * This file is part of wimlib, a library for working with WIM files.
+ * This file is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option) any
+ * later version.
  *
- * wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option)
- * any later version.
- *
- * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * This file is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with wimlib; if not, see http://www.gnu.org/licenses/.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this file; if not, see http://www.gnu.org/licenses/.
  */
 
 
@@ -86,7 +84,7 @@ xpress_decode_window(struct input_bitstream *istream, const u16 *decode_table,
        u8 *window_end = &window[window_size];
        unsigned sym;
        unsigned match_len;
-       unsigned offset_bsr;
+       unsigned offset_high_bit;
        unsigned match_offset;
 
        while (window_ptr != window_end) {
@@ -101,12 +99,12 @@ xpress_decode_window(struct input_bitstream *istream, const u16 *decode_table,
 
                /* Match  */
                match_len = sym & 0xf;
-               offset_bsr = (sym >> 4) & 0xf;
+               offset_high_bit = (sym >> 4) & 0xf;
 
                bitstream_ensure_bits(istream, 16);
 
-               match_offset = (1 << offset_bsr) |
-                               bitstream_pop_bits(istream, offset_bsr);
+               match_offset = (1 << offset_high_bit) |
+                               bitstream_pop_bits(istream, offset_high_bit);
 
                if (match_len == 0xf) {
                        match_len += bitstream_read_byte(istream);
@@ -121,7 +119,8 @@ xpress_decode_window(struct input_bitstream *istream, const u16 *decode_table,
                if (unlikely(match_len > window_end - window_ptr))
                        return -1;
 
-               lz_copy(window_ptr, match_len, match_offset, window_end);
+               lz_copy(window_ptr, match_len, match_offset, window_end,
+                       XPRESS_MIN_MATCH_LEN);
 
                window_ptr += match_len;
        }