}
for (i = 0; i < array->Count; i++)
for (j = 0; j < ClassCount; j++)
- if (read_anchor (otf, stream, offset + array->offset,
- &array->AnchorRecord[i].Anchor[j]) < 0)
+ if (array->AnchorRecord[i].Anchor[j].offset > 0
+ && read_anchor (otf, stream, offset + array->offset,
+ &array->AnchorRecord[i].Anchor[j]) < 0)
return -1;
RESTORE_STREAM (stream, state);
return 0;
unsigned ClassCount, OTF_LigatureAttach *attach)
{
char *errfmt = "LigatureAttach%s";
- int errret = 1;
+ int errret = -1;
int i, j;
SEEK_STREAM (stream, offset + attach->offset);
for (i = 0; i < array->LigatureCount; i++)
READ_OFFSET (stream, array->LigatureAttach[i].offset);
for (i = 0; i < array->LigatureCount; i++)
- read_ligature_attach (otf, stream, offset + array->offset,
- class_count, array->LigatureAttach + i);
+ if (array->LigatureAttach[i].offset > 0
+ && read_ligature_attach (otf, stream, offset + array->offset,
+ class_count, array->LigatureAttach + i) < 0)
+ return -1;
RESTORE_STREAM (stream, state);
return 0;
}
read_coverage (otf, stream, offset, &subtable->Coverage);
read_coverage (otf, stream, offset,
&subtable->u.mark_mark1.Mark2Coverage);
- READ_UINT16 (stream, subtable->u.mark_base1.ClassCount);
+ READ_UINT16 (stream, subtable->u.mark_mark1.ClassCount);
read_mark_array (otf, stream, offset,
&subtable->u.mark_mark1.Mark1Array);
read_anchor_array (otf, stream, offset,
if (OTF_get_features (otf, gsubp) < 0)
{
+ if (gsubp ? ! otf->gsub : ! otf->gpos)
+ return 0;
for (i = 0; i < n_features; i++)
{
OTF_Tag feature = features[i];
if ((((unsigned) feature) & 0x80000000) == 0)
return -1;
}
- return 1;
}
if (gsubp)
{
for (i = 0; i < Script->LangSysCount && ! LangSys; i++)
if (Script->LangSysRecord[i].LangSysTag == language)
LangSys = Script->LangSys + i;
+ if (! LangSys)
+ return 0;
}
- if (! LangSys)
+ else
LangSys = &Script->DefaultLangSys;
for (j = 0; j < n_features; j++)
{