fontforge/fontforge-eof-crash.patch

17 lines
552 B
Diff

Index: fontforge/parsettf.c
===================================================================
--- fontforge/parsettf.c.orig 2016-01-26 09:01:44.025472518 +0100
+++ fontforge/parsettf.c 2016-01-26 09:04:24.853470665 +0100
@@ -5185,7 +5185,10 @@
/* the index table is backwards from the way I want to use it */
gcbig = 0;
for ( i=0; i<gc; ++i ) {
- indexes[val = getushort(ttf)] = i;
+ val = getushort(ttf);
+ if ( val<0 ) /* Don't crash on EOF */
+ break;
+ indexes[val] = i;
if ( val>=258 ) ++gcbig;
}