# include "config.h"
#endif
+#include <string.h>
+
#include "wimlib/decompressor_ops.h"
#include "wimlib/decompress_common.h"
#include "wimlib/error.h"
#include "wimlib/lzx_common.h"
#include "wimlib/util.h"
-#include <string.h>
-
/* These values are chosen for fast decompression. */
#define LZX_MAINCODE_TABLEBITS 11
#define LZX_LENCODE_TABLEBITS 10
run_len = 4 + bitstream_read_bits(istream, 1);
presym = read_huffsym_using_precode(istream,
precode_decode_table);
+ if (unlikely(presym > 17))
+ return -1;
len = *len_ptr - presym;
if ((s8)len < 0)
len += 17;