diff --git a/util/compression.h b/util/compression.h index 5ce419c9c..207f9949e 100644 --- a/util/compression.h +++ b/util/compression.h @@ -1224,8 +1224,10 @@ inline bool LZ4HC_Compress(const CompressionInfo& info, const char* compression_dict_data = compression_dict.size() > 0 ? compression_dict.data() : nullptr; size_t compression_dict_size = compression_dict.size(); - LZ4_loadDictHC(stream, compression_dict_data, - static_cast(compression_dict_size)); + if (compression_dict_data != nullptr) { + LZ4_loadDictHC(stream, compression_dict_data, + static_cast(compression_dict_size)); + } #if LZ4_VERSION_NUMBER >= 10700 // r129+ outlen =