X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/4388f060552cc537e71e957d32f35e9d75a61233..e4f10fab0c078f399c9deef476d9c9b73b47dff8:/icuSources/layout/LookupProcessor.cpp diff --git a/icuSources/layout/LookupProcessor.cpp b/icuSources/layout/LookupProcessor.cpp index 04295852..03986baf 100644 --- a/icuSources/layout/LookupProcessor.cpp +++ b/icuSources/layout/LookupProcessor.cpp @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved + * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved * */ @@ -99,6 +99,10 @@ le_uint32 LookupProcessor::applySingleLookup(le_uint16 lookupTableIndex, GlyphIt } const LookupTable *lookupTable = lookupListTable->getLookupTable(lookupTableIndex); + if (lookupTable == NULL) { + success = LE_INTERNAL_ERROR; + return 0; + } le_uint16 lookupFlags = SWAPW(lookupTable->lookupFlags); GlyphIterator tempIterator(*glyphIterator, lookupFlags); le_uint32 delta = applyLookupTable(lookupTable, &tempIterator, fontInstance, success); @@ -199,6 +203,11 @@ LookupProcessor::LookupProcessor(const char *baseAddress, featureReferences += SWAPW(featureTable->lookupCount); } + if (!featureTable) { + success = LE_INTERNAL_ERROR; + return; + } + if (requiredFeatureIndex != 0xFFFF) { requiredFeatureTable = featureListTable->getFeatureTable(requiredFeatureIndex, &requiredFeatureTag); featureReferences += SWAPW(featureTable->lookupCount);