(read_value_record): Clear value_record at
authorhanda <handa>
Tue, 30 Mar 2004 05:08:15 +0000 (05:08 +0000)
committerhanda <handa>
Tue, 30 Mar 2004 05:08:15 +0000 (05:08 +0000)
first.
(read_lookup_subtable_gpos): For Lookup Type 1, read Coverage at
first.

src/otfopen.c

index f20a5cb..6776e21 100644 (file)
@@ -1870,6 +1870,7 @@ read_value_record (OTF *otf, OTF_Stream *stream, long offset,
   OTF_StreamState state;
   int size, i;
 
+  memset (value_record, 0, sizeof (OTF_ValueRecord));
   if (! bit)
     return 0;
   for (i = 0, size = 0; i < 8; i++)
@@ -2169,6 +2170,8 @@ read_lookup_subtable_gpos (OTF *otf, OTF_Stream *stream,
     case 1:
       if (subtable->Format == 1)
        {
+         if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
+           return -1;
          READ_UINT16 (stream, subtable->u.single1.ValueFormat);
          read_value_record (otf, stream, offset,
                             subtable->u.single1.ValueFormat,
@@ -2179,6 +2182,8 @@ read_lookup_subtable_gpos (OTF *otf, OTF_Stream *stream,
          OTF_GPOS_Single2 *single2 = &subtable->u.single2;
          int i;
 
+         if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
+           return -1;
          READ_UINT16 (stream, single2->ValueFormat);
          READ_UINT16 (stream, single2->ValueCount);
          OTF_CALLOC (single2->Value, single2->ValueCount," (ValueRecord)");