(read_ligature_attach): Fix for the case that an
authorhanda <handa>
Thu, 5 Aug 2004 05:20:13 +0000 (05:20 +0000)
committerhanda <handa>
Thu, 5 Aug 2004 05:20:13 +0000 (05:20 +0000)
offset is NULL.

src/otfopen.c

index 0fce174..60adefe 100644 (file)
@@ -2213,9 +2213,16 @@ read_ligature_attach (OTF *otf, OTF_Stream *stream, long offset,
     }
   for (i = 0; i < attach->ComponentCount; i++)
     for (j = 0; j < ClassCount; j++)
-      if (read_anchor (otf, stream, offset + attach->offset,
-                      &attach->ComponentRecord[i].LigatureAnchor[j]) < 0)
-       return -1;
+      {
+       if (attach->ComponentRecord[i].LigatureAnchor[j].offset)
+         {
+           if (read_anchor (otf, stream, offset + attach->offset,
+                            &attach->ComponentRecord[i].LigatureAnchor[j]) < 0)
+             return -1;
+         }
+       else
+         attach->ComponentRecord[i].LigatureAnchor[j].AnchorFormat = 0;
+      }
   return 0;
 }