diff options
author | Patrick Lam <plam@MIT.EDU> | 2006-02-06 14:44:46 +0000 |
---|---|---|
committer | Patrick Lam <plam@MIT.EDU> | 2006-02-06 14:44:46 +0000 |
commit | 86e75dfb5d1434837537b40e829f00f9ffbb8183 (patch) | |
tree | 60af5f46cf1db8d4c5565aacf08d0ecc697ec156 /src/fcfs.c | |
parent | f076169d19574c6c548764d574a33bc4fe022ffb (diff) | |
download | fontconfig-86e75dfb5d1434837537b40e829f00f9ffbb8183.tar.gz |
Explain apples/oranges comparison and fix compilation error.
reviewed by: plam
Diffstat (limited to 'src/fcfs.c')
-rw-r--r-- | src/fcfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -159,7 +159,10 @@ FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr) nfont = *(int *)block_ptr; block_ptr = (int *)block_ptr + 1; - if (nfont > 0 && nfont < metadata.count) + /* comparing nfont and metadata.count is a bit like comparing + apples and oranges. Its just for rejecting totally insane + nfont values, and for that its good enough */ + if (nfont > 0 && nfont < metadata->count / sizeof(void*)) { FcPattern * p = (FcPattern *)block_ptr; |