This repository has been archived by the owner on Sep 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] r-base: cairo-with-pango-but-not-X11 on macOS
- Loading branch information
1 parent
637aa09
commit b7abdf5
Showing
28 changed files
with
565 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/src/fccache.c b/src/fccache.c | ||
index 02ec301..7e4e600 100644 | ||
--- a/src/fccache.c | ||
+++ b/src/fccache.c | ||
@@ -640,6 +640,8 @@ FcCacheOffsetsValid (FcCache *cache) | ||
FcPattern *font = FcFontSetFont (fs, i); | ||
FcPatternElt *e; | ||
FcValueListPtr l; | ||
+ ssize_t c; | ||
+ char *begin; | ||
|
||
if ((char *) font < base || | ||
(char *) font > end - sizeof (FcFontSet) || | ||
@@ -653,11 +655,18 @@ FcCacheOffsetsValid (FcCache *cache) | ||
if (e->values != 0 && !FcIsEncodedOffset(e->values)) | ||
return FcFalse; | ||
|
||
- for (j = font->num, l = FcPatternEltValues(e); j >= 0 && l; j--, l = FcValueListNext(l)) | ||
- if (l->next != NULL && !FcIsEncodedOffset(l->next)) | ||
- break; | ||
- if (j < 0) | ||
- return FcFalse; | ||
+ for (j = 0; j < font->num; j++) | ||
+ { | ||
+ begin = (char *)FcPatternEltValues(&e[j]); | ||
+ c = (end - begin) / sizeof (FcValueList); | ||
+ for (l = FcPatternEltValues(&e[j]); l; l = FcValueListNext(l)) | ||
+ { | ||
+ if ((char *) l < begin || (char *)l > end - sizeof (*l) || | ||
+ (l->next != NULL && !FcIsEncodedOffset(l->next)) || | ||
+ c-- <= 0) | ||
+ return FcFalse; | ||
+ } | ||
+ } | ||
} | ||
} | ||
|
Oops, something went wrong.