Compute MaxVendor and MaxVendorIdLI at encoding if not explicitly set

This commit is contained in:
Thomas LAY
2021-02-18 10:10:02 +01:00
parent d6069d62fa
commit e60298c839
3 changed files with 29 additions and 1 deletions
+7
View File
@@ -43,6 +43,13 @@ func (a *AllowedVendors) Encode() string {
}
bitSize += entriesSize
} else {
if a.MaxVendorId == 0 {
for id, _ := range a.AllowedVendors {
if id > a.MaxVendorId {
a.MaxVendorId = id
}
}
}
bitSize += a.MaxVendorId
}