X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..6de34a005df0e4a02d88750703b950237b77d9c8:/icuSources/layout/MarkToBasePosnSubtables.cpp diff --git a/icuSources/layout/MarkToBasePosnSubtables.cpp b/icuSources/layout/MarkToBasePosnSubtables.cpp index 498aecda..6843c4a1 100644 --- a/icuSources/layout/MarkToBasePosnSubtables.cpp +++ b/icuSources/layout/MarkToBasePosnSubtables.cpp @@ -1,7 +1,6 @@ /* - * @(#)MarkToBasePosnSubtables.cpp 1.5 00/03/15 * - * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved * */ @@ -67,6 +66,12 @@ le_int32 MarkToBasePositioningSubtable::process(GlyphIterator *glyphIterator, co const AnchorTable *anchorTable = (const AnchorTable *) ((char *) baseArray + anchorTableOffset); LEPoint baseAnchor, markAdvance, pixels; + if (anchorTableOffset == 0) { + // this means the table is mal-formed... + glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); + return 0; + } + anchorTable->getAnchor(baseGlyph, fontInstance, baseAnchor); fontInstance->getGlyphAdvance(markGlyph, pixels); @@ -78,14 +83,14 @@ le_int32 MarkToBasePositioningSubtable::process(GlyphIterator *glyphIterator, co glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); if (glyphIterator->isRightToLeft()) { - glyphIterator->adjustCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); + glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); } else { LEPoint baseAdvance; fontInstance->getGlyphAdvance(baseGlyph, pixels); fontInstance->pixelsToUnits(pixels, baseAdvance); - glyphIterator->adjustCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY); + glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY); } return 1;