Merge pull request #85 from rsheeter/master

Refuse to decode woff2 files with bounding boxes for empty glyphs
This commit is contained in:
rsheeter
2017-08-23 14:05:59 -07:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -2,3 +2,4 @@
*.a *.a
/woff2_compress /woff2_compress
/woff2_decompress /woff2_decompress
/woff2_info
+8
View File
@@ -600,6 +600,14 @@ bool ReconstructGlyf(const uint8_t* data, Table* glyf_table,
instruction_size, glyph_buf.get(), glyph_buf_size, &glyph_size))) { instruction_size, glyph_buf.get(), glyph_buf_size, &glyph_size))) {
return FONT_COMPRESSION_FAILURE(); return FONT_COMPRESSION_FAILURE();
} }
} else {
// n_contours == 0; empty glyph. Must NOT have a bbox.
if (PREDICT_FALSE(have_bbox)) {
#ifdef FONT_COMPRESSION_BIN
fprintf(stderr, "Empty glyph has a bbox\n");
#endif
return FONT_COMPRESSION_FAILURE();
}
} }
loca_values[i] = out->Size() - glyf_start; loca_values[i] = out->Size() - glyf_start;