Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Commit

Permalink
Error, don't die, on table overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed May 10, 2022
1 parent 8beb4dd commit c5216dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/table_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,18 @@ impl TableSet {
if !self.is_serialized(tables::GPOS::TAG).unwrap_or(true) {
if let Some(gpos) = self.GPOS().unwrap() {
let mut gpos_data = vec![];
tables::GPOS::to_bytes(&gpos, &mut gpos_data, num_glyphs).unwrap();
if tables::GPOS::to_bytes(&gpos, &mut gpos_data, num_glyphs).is_err() {
log::error!("GPOS table overflow");
}
self.insert_raw(tables::GPOS::TAG, gpos_data)
}
}
if !self.is_serialized(tables::GSUB::TAG).unwrap_or(true) {
if let Some(gsub) = self.GSUB().unwrap() {
let mut gsub_data = vec![];
tables::GSUB::to_bytes(&gsub, &mut gsub_data, num_glyphs).unwrap();
if tables::GSUB::to_bytes(&gsub, &mut gsub_data, num_glyphs).is_err() {
log::error!("GSUB table overflow");
}
self.insert_raw(tables::GSUB::TAG, gsub_data)
}
}
Expand Down

0 comments on commit c5216dd

Please sign in to comment.