File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,14 +19,23 @@ GenStatus gz_generator::NoLiteralLengthCodeConfigurator::generate()
1919 pLiteralLengthCodesTable = new Gen32u[DEFAULT_LL_TABLE_LENGTH ];
2020 pCodeLengthCodesTable = new Gen32u[DEFAULT_CL_TABLE_LENGTH ];
2121
22- makeRandomLengthCodesTable (pLiteralLengthCodesTable, DEFAULT_LL_TABLE_LENGTH , MAX_LL_CODE_BIT_LENGTH );
22+ // Set default max LL code bit length to 14 bits (MAX_LL_CODE_BIT_LENGTH - 1u)
23+ makeRandomLengthCodesTable (pLiteralLengthCodesTable, DEFAULT_LL_TABLE_LENGTH , MAX_LL_CODE_BIT_LENGTH - 1u );
2324 makeRandomLengthCodesTable (pCodeLengthCodesTable, DEFAULT_CL_TABLE_LENGTH , MAX_CL_CODE_BIT_LENGTH );
2425
26+ numberMissedCodes = static_cast <Gen32u>(rand);
27+
28+ // Set the max LL code bit length to 15 bits for all missing codes so that all missing codes will end up
29+ // at the end of the sorted list of all LL code lengths. This will make sure that the non-missing codes
30+ // will have valid distance codes
31+ for (Gen32u i = 0u ; i < numberMissedCodes; i++)
32+ {
33+ pLiteralLengthCodesTable[i] = MAX_LL_CODE_BIT_LENGTH ;
34+ }
35+
2536 TestConfigurator::declareDynamicBlock ();
2637 TestConfigurator::declareVectorToken (LL_VECTOR , pLiteralLengthCodesTable, DEFAULT_LL_TABLE_LENGTH );
2738
28- numberMissedCodes = static_cast <Gen32u>(rand);
29-
3039 for (Gen32u i = 0u ; i < numberMissedCodes; i++)
3140 {
3241 pLiteralLengthCodesTable[i] = 0u ;
You can’t perform that action at this time.
0 commit comments