{
struct wimlib_compressor *c;
+ if (!compressor_ctype_valid(ctype))
+ return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
+
if (c_ret == NULL)
return WIMLIB_ERR_INVALID_PARAM;
if (max_block_size == 0)
return WIMLIB_ERR_INVALID_PARAM;
- if (!compressor_ctype_valid(ctype))
- return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
-
c = MALLOC(sizeof(*c));
if (c == NULL)
return WIMLIB_ERR_NOMEM;
{
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 (max_block_size == 0)
return WIMLIB_ERR_INVALID_PARAM;
- if (!decompressor_ctype_valid(ctype))
- return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
-
dec = MALLOC(sizeof(*dec));
if (dec == NULL)
return WIMLIB_ERR_NOMEM;