lzms_compress.c: honor LZMS_MAX_BUFFER_SIZE
authorEric Biggers <ebiggers3@gmail.com>
Sat, 3 Jan 2015 01:43:00 +0000 (19:43 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 3 Jan 2015 01:44:07 +0000 (19:44 -0600)
src/lzms_compress.c

index 8ba9bcbc1cfa9bd9ef97e1381d25eaad4dc8c47f..096862e59c1eb39fc9ab5bb1b7b479406e7342ca 100644 (file)
@@ -1445,7 +1445,7 @@ lzms_get_needed_memory(size_t max_block_size, unsigned int compression_level)
        struct lz_mf_params mf_params;
        u64 size = 0;
 
-       if (max_block_size >= INT32_MAX)
+       if (max_block_size > LZMS_MAX_BUFFER_SIZE)
                return 0;
 
        lzms_build_params(compression_level, &params);
@@ -1478,7 +1478,7 @@ lzms_create_compressor(size_t max_block_size, unsigned int compression_level,
        struct lzms_compressor_params params;
        struct lz_mf_params mf_params;
 
-       if (max_block_size >= INT32_MAX)
+       if (max_block_size > LZMS_MAX_BUFFER_SIZE)
                return WIMLIB_ERR_INVALID_PARAM;
 
        lzms_build_params(compression_level, &params);