diff --git a/src/ftxgpos.c b/src/ftxgpos.c index dee172991..3ebb3023a 100644 --- a/src/ftxgpos.c +++ b/src/ftxgpos.c @@ -2080,6 +2080,12 @@ FORGET_Frame(); + if (new_offset == base_offset) { + /* Doulos SIL Regular is buggy and has zer offsets here. Skip */ + ban[n].PosFormat = 0; + continue; + } + cur_offset = FILE_Pos(); if ( FILE_Seek( new_offset ) || ( error = Load_Anchor( &ban[n], stream ) ) != TT_Err_Ok ) diff --git a/src/ftxopen.c b/src/ftxopen.c index 75f66be5f..c2f04850f 100644 --- a/src/ftxopen.c +++ b/src/ftxopen.c @@ -631,9 +631,11 @@ if ( FILE_Seek( new_offset ) || ACCESS_Frame( 8L ) ) goto Fail; - (void)GET_UShort(); /* format should be 1 */ + if (GET_UShort() != 1) /* format should be 1 */ + goto Fail; + l->LookupType = GET_UShort(); - new_offset = GET_ULong() + base_offset; + new_offset += GET_ULong(); FORGET_Frame(); }