ALLOC_OBJ_CLEAR (compctx, struct compress_context);
compctx->flags = opt->flags;
compctx->alg = comp_stub_alg;
- (*compctx->alg.compress_init)(compctx);
break;
case COMP_ALGV2_UNCOMPRESSED:
ALLOC_OBJ_CLEAR (compctx, struct compress_context);
ALLOC_OBJ_CLEAR (compctx, struct compress_context);
compctx->flags = opt->flags;
compctx->alg = lzo_alg;
- (*compctx->alg.compress_init)(compctx);
break;
#endif
#ifdef ENABLE_LZ4
ALLOC_OBJ_CLEAR (compctx, struct compress_context);
compctx->flags = opt->flags;
compctx->alg = lz4_alg;
- (*compctx->alg.compress_init)(compctx);
break;
case COMP_ALGV2_LZ4:
ALLOC_OBJ_CLEAR (compctx, struct compress_context);
break;
#endif
}
+ if (compctx)
+ (*compctx->alg.compress_init)(compctx);
+
return compctx;
}
VERIFY_PERMISSION (OPT_P_COMP);
if (p[1])
{
- options->comp.flags = 0;
if (streq (p[1], "stub"))
{
options->comp.alg = COMP_ALG_STUB;
else if (streq (p[1], "lzo"))
{
options->comp.alg = COMP_ALG_LZO;
+ options->comp.flags = 0;
}
#endif
#if defined(ENABLE_LZ4)
else if (streq (p[1], "lz4-v2"))
{
options->comp.alg = COMP_ALGV2_LZ4;
+ options->comp.flags = 0;
}
#endif
else