Add some more protection against inconsistent state.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26771 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-07-12 21:10:08 +00:00
parent bcd595e826
commit 1f1fb3c153
3 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2008-07-12 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSLayoutManager.m (-_glyphForCharacter:index:positions::),
* Source/NSGlyphGenerator.m (-generateGlyphsForGlyphStorage:...):
Add some more protection against inconsistent state.
2008-07-12 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSSavePanel.m (-ok:): Standardize path before checking

View file

@ -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;

View file

@ -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];