diff --git a/ChangeLog b/ChangeLog index 40c236239..7a5744c0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-12 Fred Kiefer + + * Source/GSLayoutManager.m (-_glyphForCharacter:index:positions::), + * Source/NSGlyphGenerator.m (-generateGlyphsForGlyphStorage:...): + Add some more protection against inconsistent state. + 2008-07-12 Fred Kiefer * Source/NSSavePanel.m (-ok:): Standardize path before checking diff --git a/Source/GSLayoutManager.m b/Source/GSLayoutManager.m index c0f008d11..aec3915d8 100644 --- a/Source/GSLayoutManager.m +++ b/Source/GSLayoutManager.m @@ -768,8 +768,12 @@ Fills in all glyph holes up to last. only looking at levels below level int lo, hi, mid, i; r = run_for_character_index(target, glyphs, &pos, &cpos); - if (!r) - return NULL; + if (!r || !r->glyphs) + { + [NSException raise: NSRangeException + format: @"%s character index out of range", __PRETTY_FUNCTION__]; + return NULL; + } target -= cpos; diff --git a/Source/NSGlyphGenerator.m b/Source/NSGlyphGenerator.m index 0ac057b70..361431397 100644 --- a/Source/NSGlyphGenerator.m +++ b/Source/NSGlyphGenerator.m @@ -116,6 +116,12 @@ fb04 'ffl' longestEffectiveRange: &curRange inRange: maxRange]; fi = [[self fontForCharactersWithAttributes: attributes] fontInfo]; + if (!fi) + { + [NSException raise: NSGenericException + format: @"Glyph generation with no font."]; + return; + } glyphForCharacter = (NSGlyph(*)(id, SEL, unichar)) [fi methodForSelector: gfc_sel]; n = [attributes objectForKey: NSLigatureAttributeName];