diff options
author | marha <marha@users.sourceforge.net> | 2013-01-17 09:25:28 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-01-17 09:25:28 +0100 |
commit | 50c07563e17397daf040a32d8fdd3ab397e72371 (patch) | |
tree | ae9c109e16ba86a498c43ab62830bca3641a78aa /fontconfig/src | |
parent | dc163f625ef006c8550791122bda28fb3eb67e3d (diff) | |
parent | 4fc6b34d1c14cc61f553ca59264d0909656933f3 (diff) | |
download | vcxsrv-50c07563e17397daf040a32d8fdd3ab397e72371.tar.gz vcxsrv-50c07563e17397daf040a32d8fdd3ab397e72371.tar.bz2 vcxsrv-50c07563e17397daf040a32d8fdd3ab397e72371.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig libxcb mesa xkbcomp git update 17 jan 2013
Diffstat (limited to 'fontconfig/src')
-rwxr-xr-x | fontconfig/src/fccache.c | 7 | ||||
-rw-r--r-- | fontconfig/src/fccfg.c | 4 | ||||
-rw-r--r-- | fontconfig/src/fcdefault.c | 28 | ||||
-rw-r--r-- | fontconfig/src/fcfreetype.c | 3 |
4 files changed, 29 insertions, 13 deletions
diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c index c37cbe148..d894fc2b6 100755 --- a/fontconfig/src/fccache.c +++ b/fontconfig/src/fccache.c @@ -449,6 +449,9 @@ FcCacheFindByAddrUnlocked (void *object) FcCacheSkip **next = fcCacheChains; FcCacheSkip *s; + if (!object) + return NULL; + /* * Walk chain pointers one level at a time */ @@ -556,7 +559,7 @@ FcCacheObjectDereference (void *object) skip = FcCacheFindByAddrUnlocked (object); if (skip) { - if (FcRefDec (&skip->ref) <= 1) + if (FcRefDec (&skip->ref) == 1) FcDirCacheDisposeUnlocked (skip->cache); } unlock_cache (); @@ -1109,6 +1112,7 @@ FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose) cache_dir, ent->d_name, target_dir); remove = FcTrue; } + FcDirCacheUnload (cache); } if (remove) { @@ -1118,7 +1122,6 @@ FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose) ret = FcFalse; } } - FcDirCacheUnload (cache); FcStrFree (file_name); } diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index 3e9fdaba4..12d7e1a97 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -337,8 +337,8 @@ FcConfigAddCache (FcConfig *config, FcCache *cache, if (!FcConfigAcceptFont (config, font)) continue; - nref++; - FcFontSetAdd (config->fonts[set], font); + if (FcFontSetAdd (config->fonts[set], font)) + nref++; } FcDirCacheReference (cache, nref); } diff --git a/fontconfig/src/fcdefault.c b/fontconfig/src/fcdefault.c index aa47840d1..b1bd9cc1f 100644 --- a/fontconfig/src/fcdefault.c +++ b/fontconfig/src/fcdefault.c @@ -23,6 +23,7 @@ */ #include "fcint.h" +#include <limits.h> #include <string.h> /* MT-safe */ @@ -139,27 +140,38 @@ retry: prgname = FcStrdup (p); } +#elif defined (HAVE_GETPROGNAME) + const char *q = getprogname (); + if (q) + prgname = FcStrdup (q); + else + prgname = FcStrdup (""); #else - char buf[8192]; + char buf[PATH_MAX + 1]; unsigned int len; + char *p = NULL; len = readlink ("/proc/self/exe", buf, sizeof (buf) - 1); if (len > 0) { - char *p; + buf[len] = '\0'; + p = buf; + } - p = strrchr (buf, '/'); - if (p) - p++; + if (p) + { + char *r = strrchr (p, '/'); + if (r) + r++; else - p = buf; + r = p; - prgname = FcStrdup (p); + prgname = FcStrdup (r); } -#endif if (!prgname) prgname = FcStrdup (""); +#endif if (!fc_atomic_ptr_cmpexch (&default_prgname, NULL, prgname)) { free (prgname); diff --git a/fontconfig/src/fcfreetype.c b/fontconfig/src/fcfreetype.c index e88c37770..cb502438f 100644 --- a/fontconfig/src/fcfreetype.c +++ b/fontconfig/src/fcfreetype.c @@ -1706,7 +1706,8 @@ FcFreeTypeQueryFace (const FT_Face face, { const char *font_format = FT_Get_X11_Font_Format (face); if (font_format) - FcPatternAddString (pat, FC_FONTFORMAT, (FcChar8 *) font_format); + if (!FcPatternAddString (pat, FC_FONTFORMAT, (FcChar8 *) font_format)) + goto bail2; } #endif |