mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement get_table_for_tag on FreeType
Also fixes use-after-free of FontTable buffers.
This commit is contained in:
parent
3f9b6f8586
commit
afafb0b71c
10 changed files with 41 additions and 33 deletions
|
@ -192,10 +192,10 @@ impl FontHandleMethods for FontHandle {
|
|||
return metrics;
|
||||
}
|
||||
|
||||
fn get_table_for_tag(&self, tag: FontTableTag) -> Option<FontTable> {
|
||||
fn get_table_for_tag(&self, tag: FontTableTag) -> Option<Box<FontTable>> {
|
||||
let result: Option<CFData> = self.ctfont.get_font_table(tag);
|
||||
result.and_then(|data| {
|
||||
Some(FontTable::wrap(data))
|
||||
Some(box FontTable::wrap(data))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue