Fix wrong search_range computation

This commit is contained in:
Laurenz 2022-04-05 17:02:43 +02:00
parent b8233a9e01
commit 20b4d590b3
2 changed files with 2 additions and 1 deletions

View File

@ -89,7 +89,7 @@ impl<'a> Subsetter<'a> {
// Write table directory. // Write table directory.
let count = self.tables.len() as u16; let count = self.tables.len() as u16;
let entry_selector = (count as f32).log2().floor() as u16; let entry_selector = (count as f32).log2().floor() as u16;
let search_range = entry_selector.pow(2) * 16; let search_range = 2u16.pow(u32::from(entry_selector)) * 16;
let range_shift = count * 16 - search_range; let range_shift = count * 16 - search_range;
w.write(count); w.write(count);
w.write(search_range); w.write(search_range);

View File

@ -1,4 +1,5 @@
// General tests for set. // General tests for set.
// Ref: false
--- ---
// Error: 2-10 set, show and wrap are only allowed directly in markup // Error: 2-10 set, show and wrap are only allowed directly in markup