From d457fd9766282fb3bb343343d609cbc967540961 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 5 Aug 2004 05:20:13 +0000 Subject: [PATCH] (read_ligature_attach): Fix for the case that an offset is NULL. --- src/otfopen.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/otfopen.c b/src/otfopen.c index 0fce174..60adefe 100644 --- a/src/otfopen.c +++ b/src/otfopen.c @@ -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; } -- 1.7.10.4