From: kramm Date: Thu, 5 Feb 2004 13:41:50 +0000 (+0000) Subject: swf_LoadFont() now returns more quickly if the file doesn't exist. X-Git-Tag: release-0-5-0~28 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=fa9f93ed6eac01d72ba26e2e72d2ceee78ffd3f9;p=swftools.git swf_LoadFont() now returns more quickly if the file doesn't exist. --- 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)