]> wimlib.net Git - wimlib/blobdiff - src/decompress.c
Compression updates
[wimlib] / src / decompress.c
index 9287ca092767e56182dad10a927e700edb8e168f..b8ed8dfcfe03186b33a119c4069e31d2709f5bca 100644 (file)
@@ -59,11 +59,14 @@ wimlib_create_decompressor(enum wimlib_compression_type ctype,
 {
        struct wimlib_decompressor *dec;
 
+       if (!decompressor_ctype_valid(ctype))
+               return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
+
        if (dec_ret == NULL)
                return WIMLIB_ERR_INVALID_PARAM;
 
-       if (!decompressor_ctype_valid(ctype))
-               return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
+       if (max_block_size == 0)
+               return WIMLIB_ERR_INVALID_PARAM;
 
        dec = MALLOC(sizeof(*dec));
        if (dec == NULL)