diff --git a/icu4c/source/layout/DeviceTables.cpp b/icu4c/source/layout/DeviceTables.cpp index 34a08688da0..1882ede5a7e 100644 --- a/icu4c/source/layout/DeviceTables.cpp +++ b/icu4c/source/layout/DeviceTables.cpp @@ -1,7 +1,7 @@ /* * @(#)DeviceTables.cpp 1.5 00/03/15 * - * (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved + * (C) Copyright IBM Corp. 1998 - 2004 - All Rights Reserved * */ @@ -36,7 +36,7 @@ le_int16 DeviceTable::getAdjustment(le_uint16 ppem) const result = field; if ((field & fieldSignBits[format]) != 0) { - result |= ! fieldMasks[format]; + result |= ~ fieldMasks[format]; } } diff --git a/icu4c/source/layout/PairPositioningSubtables.cpp b/icu4c/source/layout/PairPositioningSubtables.cpp index 575d1eaa4a9..7b31ac8618c 100644 --- a/icu4c/source/layout/PairPositioningSubtables.cpp +++ b/icu4c/source/layout/PairPositioningSubtables.cpp @@ -52,12 +52,16 @@ le_uint32 PairPositioningFormat1Subtable::process(GlyphIterator *glyphIterator, if (coverageIndex >= 0 && glyphIterator->next()) { Offset pairSetTableOffset = SWAPW(pairSetTableOffsetArray[coverageIndex]); PairSetTable *pairSetTable = (PairSetTable *) ((char *) this + pairSetTableOffset); + le_uint16 pairValueCount = SWAPW(pairSetTable->pairValueCount); le_int16 valueRecord1Size = ValueRecord::getSize(SWAPW(valueFormat1)); le_int16 valueRecord2Size = ValueRecord::getSize(SWAPW(valueFormat2)); le_int16 recordSize = sizeof(PairValueRecord) - sizeof(ValueRecord) + valueRecord1Size + valueRecord2Size; LEGlyphID secondGlyph = glyphIterator->getCurrGlyphID(); - const PairValueRecord *pairValueRecord = - findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, SWAPW(pairSetTable->pairValueCount), recordSize); + const PairValueRecord *pairValueRecord = NULL; + + if (pairValueCount != 0) { + pairValueRecord = findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize); + } if (pairValueRecord == NULL) { return 0;