Bug 372639. Don't die if the font selection code gives us more glyphs than we're supposed to have (just assert). r=pavlov

This commit is contained in:
roc+%cs.cmu.edu 2007-03-19 03:27:55 +00:00
Родитель 4659d810e7
Коммит dd8f7bcce2
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -931,6 +931,10 @@ gfxPangoFontGroup::SetGlyphs(gfxTextRun* aTextRun,
nsAutoTArray<gfxTextRun::DetailedGlyph,1> detailedGlyphs;
while (index < aUTF8Length) {
if (utf16Offset >= textRunLength) {
NS_ERROR("Someone has added too many glyphs!");
break;
}
if (aUTF8[index] == 0) {
// treat this null byte as a missing glyph
aTextRun->SetCharacterGlyph(utf16Offset, g.SetMissing());