X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fdecompress.c;h=b8ed8dfcfe03186b33a119c4069e31d2709f5bca;hb=2915014b741493083571954e10c8add9dc09a522;hp=4ebd940d0ac074ce7d8e52ca122b84b09c9ce159;hpb=c78f76969f2f3c68b830defd4d495563a41e7129;p=wimlib diff --git a/src/decompress.c b/src/decompress.c index 4ebd940d..b8ed8dfc 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -59,15 +59,15 @@ 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 (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;