diff options
author | Akira TAGOH <akira@tagoh.org> | 2014-01-31 11:10:02 +0900 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2014-01-31 11:10:02 +0900 |
commit | 80081555fdffea927a53fce2773cfbe9db4c51f0 (patch) | |
tree | b12ccb67f7d2a3601b0ae5a9f50681818529d7ca | |
parent | e2b406053c2937799da8636c56b72a77998bcab0 (diff) | |
download | fontconfig-80081555fdffea927a53fce2773cfbe9db4c51f0.tar.gz fontconfig-80081555fdffea927a53fce2773cfbe9db4c51f0.tar.bz2 fontconfig-80081555fdffea927a53fce2773cfbe9db4c51f0.zip |
Fix a crash issue when empty strings are set to the BDF properties
-rw-r--r-- | src/fcfreetype.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fcfreetype.c b/src/fcfreetype.c index e3943076..d271d69e 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -1586,7 +1586,7 @@ FcFreeTypeQueryFace (const FT_Face face, } if (width == -1 && FT_Get_BDF_Property (face, "SETWIDTH_NAME", &prop) == 0 && - prop.type == BDF_PROPERTY_TYPE_ATOM) + prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom != NULL) { width = FcIsWidth ((FcChar8 *) prop.u.atom); if (FcDebug () & FC_DBG_SCANV) @@ -1716,7 +1716,7 @@ bail3: /* For PCF fonts, override the computed spacing with the one from the property */ if(FT_Get_BDF_Property(face, "SPACING", &prop) == 0 && - prop.type == BDF_PROPERTY_TYPE_ATOM) { + prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom != NULL) { if(!strcmp(prop.u.atom, "c") || !strcmp(prop.u.atom, "C")) spacing = FC_CHARCELL; else if(!strcmp(prop.u.atom, "m") || !strcmp(prop.u.atom, "M")) |