提交 f49b5da0 编写于 作者: B bae

8219066: Fuzzing TrueType fonts: setCurrGlyphID()

Reviewed-by: andrew, mbalao
Contributed-by: NMartin Balao <mbalao@redhat.com>
上级 39ee8d45
...@@ -67,7 +67,10 @@ void ContextualSubstitutionBase::applySubstitutionLookups( ...@@ -67,7 +67,10 @@ void ContextualSubstitutionBase::applySubstitutionLookups(
le_uint16 lookupListIndex = SWAPW(substLookupRecordArrayPtr[subst].lookupListIndex); le_uint16 lookupListIndex = SWAPW(substLookupRecordArrayPtr[subst].lookupListIndex);
tempIterator.setCurrStreamPosition(position); tempIterator.setCurrStreamPosition(position);
tempIterator.next(sequenceIndex); if (!tempIterator.next(sequenceIndex)) {
success = LE_INTERNAL_ERROR;
return;
}
lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance, success); lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance, success);
} }
......
...@@ -224,6 +224,16 @@ void GlyphIterator::getCursiveExitPoint(LEPoint &exitPoint) const ...@@ -224,6 +224,16 @@ void GlyphIterator::getCursiveExitPoint(LEPoint &exitPoint) const
void GlyphIterator::setCurrGlyphID(TTGlyphID glyphID) void GlyphIterator::setCurrGlyphID(TTGlyphID glyphID)
{ {
if (direction < 0) {
if (position <= nextLimit || position >= prevLimit) {
return;
}
} else {
if (position <= prevLimit || position >= nextLimit) {
return;
}
}
LEGlyphID glyph = glyphStorage[position]; LEGlyphID glyph = glyphStorage[position];
glyphStorage[position] = LE_SET_GLYPH(glyph, glyphID); glyphStorage[position] = LE_SET_GLYPH(glyph, glyphID);
......
...@@ -67,7 +67,10 @@ void SubstitutionLookup::applySubstitutionLookups( ...@@ -67,7 +67,10 @@ void SubstitutionLookup::applySubstitutionLookups(
le_uint16 lookupListIndex = SWAPW(substLookupRecordArray[subst].lookupListIndex); le_uint16 lookupListIndex = SWAPW(substLookupRecordArray[subst].lookupListIndex);
tempIterator.setCurrStreamPosition(position); tempIterator.setCurrStreamPosition(position);
tempIterator.next(sequenceIndex); if (!tempIterator.next(sequenceIndex)) {
success = LE_INTERNAL_ERROR;
return;
}
lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance, success); lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance, success);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册