]> git.wh0rd.org Git - fontconfig.git/commitdiff
Explain apples/oranges comparison and fix compilation error.
authorPatrick Lam <plam@MIT.EDU>
Mon, 6 Feb 2006 14:44:46 +0000 (14:44 +0000)
committerPatrick Lam <plam@MIT.EDU>
Mon, 6 Feb 2006 14:44:46 +0000 (14:44 +0000)
reviewed by: plam

ChangeLog
src/fcfs.c

index 8b9c55d36c4f6efa4cc92450ab986589f9048c84..330e7687f9bf19333c979b3ac69eb4dec562fd95 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-06  Dirk Mueller  <dmueller@suse.de>
+       reviewed by: plam
+
+       * src/fcfs.c (FcFontSetUnserialize):
+
+       Explain apples/oranges comparison and fix compilation error.
+
 2006-02-06  Dirk Mueller  <dmueller@suse.de>
        reviewed by: plam
 
index 50049bac3833ff4e6cb9f00502610e40f3ecb8fb..cbb5dc7f0d3985fb9485114963690283eae879f6 100644 (file)
@@ -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;