Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 93a8d4b

Browse files
committed
Do not retrieve the number of contours for empty glyphs
Before this change php-font-lib always read the number of contours for a glyph. If a glyph has no data the read information would be incorrect. This could lead to invalid parsing of the glyph since the data may not represent the actual glyph format (simple). In fact, the data could be from outside the glyf table entirely. If the glyph was positioned as the last byte in the font a read error would be thrown.
1 parent a5c850b commit 93a8d4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/FontLib/Glyph/Outline.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Outline extends BinaryStream {
4848
static function init(glyf $table, $offset, $size, BinaryStream $font) {
4949
$font->seek($offset);
5050

51-
if ($font->readInt16() > -1) {
51+
if ($size === 0 || $font->readInt16() > -1) {
5252
/** @var OutlineSimple $glyph */
5353
$glyph = new OutlineSimple($table, $offset, $size);
5454
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /