From fa9f93ed6eac01d72ba26e2e72d2ceee78ffd3f9 Mon Sep 17 00:00:00 2001 From: kramm Date: Thu, 5 Feb 2004 13:41:50 +0000 Subject: [PATCH] swf_LoadFont() now returns more quickly if the file doesn't exist. --- lib/modules/swffont.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/modules/swffont.c b/lib/modules/swffont.c index f8f7707..21a19e6 100644 --- a/lib/modules/swffont.c +++ b/lib/modules/swffont.c @@ -414,7 +414,7 @@ static int isSWF(const char*filename) char a[8]; if(!fi) { perror(filename); - return 0; + return -1; } memset(a, 0, sizeof(a)); fread(a, 4, 1, fi); @@ -428,7 +428,10 @@ static int isSWF(const char*filename) SWFFONT* swf_LoadFont(char*filename) { - if(isSWF(filename)) { + int is_swf = isSWF(filename); + if(is_swf<0) + return 0; + if(is_swf) { return swf_ReadFont(filename); } #if defined(HAVE_FREETYPE) -- 1.7.10.4