1
0
mirror of https://github.com/chylex/Brotli-Builder.git synced 2025-04-07 00:15:50 +02:00

Ensure empty command length code lists don't throw an exception

This commit is contained in:
chylex 2020-04-07 22:49:23 +02:00
parent fb70490404
commit c229d678d6

View File

@ -275,6 +275,12 @@ namespace BrotliLib.Brotli.Encode.Build{
}
}
foreach(var icLengthCodeList in icLengthCodeFreq){
if (icLengthCodeList.Count == 0){
icLengthCodeList.Add(new InsertCopyLengthCode(0));
}
}
foreach(var distanceCodeList in distanceCodeFreq){
if (distanceCodeList.Count == 0){
distanceCodeList.Add(DistanceCode.Zero);