changeset 12793:a9429d90157a

avoid using corrupted font descriptions patch by Daniel von Dincklage <danielvd+mpl@cs.colorado.edu>
author faust3
date Sun, 11 Jul 2004 12:42:19 +0000
parents 0d9fe5027971
children 0d17f2b4292c
files libvo/font_load.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/font_load.c	Sat Jul 10 20:56:25 2004 +0000
+++ b/libvo/font_load.c	Sun Jul 11 12:42:19 2004 +0000
@@ -245,10 +245,19 @@
       }
   }
   printf("Syntax error in font desc: %s\n",sor);
+  free(desc);
+  fclose(f);
+  return NULL;
 
 }
 fclose(f);
 
+ if (first == 1) {
+   printf("%s is empty or a directory, ignoring\n", fname);
+   free(desc);
+   return NULL;
+ }
+
 //printf("font: pos of U = %d\n",desc->start[218]);
 
 for(i=0;i<=fontdb;i++){