X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fxpress-compress.c;h=005a0a22452692d47372907255838ed61d8aa81d;hp=ad9dcff76de3718ba19a4a902bb4dfe4deb39353;hb=b616fa5792170a874658735bf6ce9a36bbc97e6a;hpb=35ff480326a41f7f74fe0a497c636a811922f276 diff --git a/src/xpress-compress.c b/src/xpress-compress.c index ad9dcff7..005a0a22 100644 --- a/src/xpress-compress.c +++ b/src/xpress-compress.c @@ -39,7 +39,7 @@ #ifdef HAVE_ALLOCA_H # include #endif - +#include #include /* Intermediate XPRESS match/literal representation. */ @@ -164,7 +164,6 @@ wimlib_xpress_compress(const void * restrict uncompressed_data, input_idx_t num_matches; input_idx_t compressed_len; input_idx_t i; - const size_t stack_max = 65536; /* XPRESS requires 256 bytes of overhead for the Huffman code, so it's * impossible to compress 256 bytes or less of data to less than the @@ -178,7 +177,7 @@ wimlib_xpress_compress(const void * restrict uncompressed_data, if (uncompressed_len < XPRESS_NUM_SYMBOLS / 2 + 1 + 4) return 0; - if (uncompressed_len <= stack_max) { + if (uncompressed_len <= STACK_MAX) { matches = alloca(uncompressed_len * sizeof(matches[0])); udata = alloca(uncompressed_len + 8); prev_tab = alloca(uncompressed_len * sizeof(prev_tab[0])); @@ -259,7 +258,7 @@ wimlib_xpress_compress(const void * restrict uncompressed_data, #endif out_free: - if (uncompressed_len > stack_max) { + if (uncompressed_len > STACK_MAX) { FREE(matches); FREE(udata); FREE(prev_tab);