Mercurial > mplayer.hg
changeset 217:cb3b0d65dddd
Search font files in ~/.mplayer/font/ instead of current dir
author | lgb |
---|---|
date | Mon, 26 Mar 2001 20:28:09 +0000 |
parents | 338b5664ea13 |
children | fbfc2077ba72 |
files | libvo/font_load.c |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/font_load.c Mon Mar 26 17:16:27 2001 +0000 +++ b/libvo/font_load.c Mon Mar 26 20:28:09 2001 +0000 @@ -109,8 +109,12 @@ if(strcmp(section,"[files]")==0){ if(pdb==2 && strcmp(p[0],"alpha")==0){ - char *cp=get_path("font/"); - char *cp2=malloc(strlen(cp)+strlen(p[1])+1); + char *cp,*cp2; + if (!(cp=get_path("font/"))) return NULL; + if (!(cp2=malloc(strlen(cp)+strlen(p[1])+1))) { + free(cp); + return NULL; + } sprintf(cp2,"%s%s",cp,p[1]); if(!((desc->pic_a[fontdb]=load_raw(cp2)))){ printf("Can't load font bitmap: %s\n",p[1]); @@ -123,8 +127,12 @@ continue; } if(pdb==2 && strcmp(p[0],"bitmap")==0){ - char *cp=get_path("font/"); - char *cp2=malloc(strlen(cp)+strlen(p[1])+1); + char *cp,*cp2; + if (!(cp=get_path("font/"))) return NULL; + if (!(cp2=malloc(strlen(cp)+strlen(p[1])+1))) { + free(cp); + return NULL; + } sprintf(cp2,"%s%s",cp,p[1]); if(!((desc->pic_b[fontdb]=load_raw(cp2)))){ printf("Can't load font bitmap: %s\n",p[1]);