From 27649fb62bf94af9c58f14cfa6c6414d8b8643f6 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 29 Oct 2007 22:00:58 +0000 Subject: [PATCH] * src/winfonts/winfnt.c (FNT_Face_Init): Check first that the driver can handle the font at all, then check `face_index'. Otherwise, the driver might return the wrong error code. This fixes Savannah bug #21468. --- ChangeLog | 7 +++++++ src/winfonts/winfnt.c | 10 +++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3533b99c2..9b0a92a85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-10-29 Daniel Svoboda + + * src/winfonts/winfnt.c (FNT_Face_Init): Check first that the driver + can handle the font at all, then check `face_index'. Otherwise, the + driver might return the wrong error code. This fixes Savannah bug + #21468. + 2006-10-21 Werner Lemberg * src/sfnt/sfobjs.c (sfnt_load_face): Support bit 9 and prepare diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c index a56fe6052..6b768fb90 100644 --- a/src/winfonts/winfnt.c +++ b/src/winfonts/winfnt.c @@ -697,13 +697,6 @@ /* this didn't work; try to load a single FNT font */ FNT_Font font; - - if ( face_index > 0 ) - { - error = FNT_Err_Bad_Argument; - goto Exit; - } - if ( FT_NEW( face->font ) ) goto Exit; @@ -714,6 +707,9 @@ font->fnt_size = stream->size; error = fnt_font_load( font, stream ); + + if ( !error && face_index > 0 ) + error = FNT_Err_Bad_Argument; } if ( error )