diff --git a/lib/common/fse_decompress.c b/lib/common/fse_decompress.c index 8e3f0035..4c66c3b7 100644 --- a/lib/common/fse_decompress.c +++ b/lib/common/fse_decompress.c @@ -139,8 +139,8 @@ size_t FSE_buildDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned { U32 u; for (u=0; usmaller:0*, meaning the next candidate will be considered smaller. + * to *sorted=>smaller:0*, meaning next candidate will be considered smaller. * This could be wrong, and result in data corruption. + * * On second thought, this corruption might be impossible, - * because unsorted elements are always at the beginning of the list, - * and squashing to zero reduce the list to a single element, + * because unsorted elements stand at the beginning of the list, + * and squashing to zero reduces the list to a single element, * which needs to be sorted anyway. * I haven't spent much thoughts into this possible scenario, - * and just felt it was safer to implement ZSTD_preserveUnsortedMark() */ + * and just felt it was safer to implement ZSTD_preserveUnsortedMark() + * + * `size` : must be a positive multiple of ZSTD_ROWSIZE */ +#define ZSTD_ROWSIZE 16 void ZSTD_preserveUnsortedMark (U32* const table, U32 const size, U32 const reducerValue) { - U32 u; - for (u=0; udtable; return 0; case set_repeat: if (!flagRepeatTable) return ERROR(corruption_detected);