Allow ZSTD_selectBlockCompressor() to Return NULL

Return an error rather than segfaulting.
This commit is contained in:
W. Felix Handte
2023-05-04 12:18:58 -04:00
parent 7806d80338
commit cbf3e26316
2 changed files with 13 additions and 6 deletions
+2
View File
@@ -672,6 +672,8 @@ size_t ZSTD_ldm_blockCompress(rawSeqStore_t* rawSeqStore,
/* Input positions */
BYTE const* ip = istart;
RETURN_ERROR_IF(blockCompressor == NULL, parameter_combination_unsupported, "Got NULL block compressor!");
DEBUGLOG(5, "ZSTD_ldm_blockCompress: srcSize=%zu", srcSize);
/* If using opt parser, use LDMs only as candidates rather than always accepting them */
if (cParams->strategy >= ZSTD_btopt) {