aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcmatch.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-22 09:28:23 +0100
committermarha <marha@users.sourceforge.net>2012-02-22 09:28:23 +0100
commitecc59cb52ffe4a84fddae997bba64adad35d5e93 (patch)
tree233c2cf0ea65dcf0b671f28e14b1fb083dac87e3 /fontconfig/src/fcmatch.c
parentd19dd4c9cf37b7b691552c4f4dd873471e31ca68 (diff)
parent6baac61e6ca9cd314e689dfe7f84771aad08c66e (diff)
downloadvcxsrv-ecc59cb52ffe4a84fddae997bba64adad35d5e93.tar.gz
vcxsrv-ecc59cb52ffe4a84fddae997bba64adad35d5e93.tar.bz2
vcxsrv-ecc59cb52ffe4a84fddae997bba64adad35d5e93.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'fontconfig/src/fcmatch.c')
-rw-r--r--fontconfig/src/fcmatch.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c
index 1b9162b46..422bc384d 100644
--- a/fontconfig/src/fcmatch.c
+++ b/fontconfig/src/fcmatch.c
@@ -23,6 +23,7 @@
*/
#include "fcint.h"
+#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
@@ -395,6 +396,9 @@ FcFontRenderPrepare (FcConfig *config,
FcValue v;
FcResult result;
+ assert (pat != NULL);
+ assert (font != NULL);
+
new = FcPatternCreate ();
if (!new)
return 0;
@@ -514,6 +518,10 @@ FcFontSetMatch (FcConfig *config,
{
FcPattern *best;
+ assert (sets != NULL);
+ assert (p != NULL);
+ assert (result != NULL);
+
if (!config)
{
config = FcConfigGetCurrent ();
@@ -536,6 +544,9 @@ FcFontMatch (FcConfig *config,
int nsets;
FcPattern *best;
+ assert (p != NULL);
+ assert (result != NULL);
+
if (!config)
{
config = FcConfigGetCurrent ();
@@ -672,6 +683,19 @@ FcFontSetSort (FcConfig *config,
FcBool *patternLangSat;
FcValue patternLang;
+ assert (sets != NULL);
+ assert (p != NULL);
+ assert (result != NULL);
+
+ /* There are some implementation that relying on the result of
+ * "result" to check if the return value of FcFontSetSort
+ * is valid or not.
+ * So we should initialize it to the conservative way since
+ * this function doesn't return NULL anymore.
+ */
+ if (result)
+ *result = FcResultNoMatch;
+
if (FcDebug () & FC_DBG_MATCH)
{
printf ("Sort ");
@@ -686,7 +710,7 @@ FcFontSetSort (FcConfig *config,
nnodes += s->nfont;
}
if (!nnodes)
- goto bail0;
+ return FcFontSetCreate ();
for (nPatternLang = 0;
FcPatternGet (p, FC_LANG, nPatternLang, &patternLang) == FcResultMatch;
@@ -822,6 +846,9 @@ FcFontSort (FcConfig *config,
FcFontSet *sets[2];
int nsets;
+ assert (p != NULL);
+ assert (result != NULL);
+
if (!config)
{
config = FcConfigGetCurrent ();