From: Patrick Lam Date: Mon, 6 Feb 2006 14:44:46 +0000 (+0000) Subject: Explain apples/oranges comparison and fix compilation error. X-Git-Tag: fc-2_3_94~39 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=86e75dfb5d1434837537b40e829f00f9ffbb8183;p=fontconfig.git Explain apples/oranges comparison and fix compilation error. reviewed by: plam --- diff --git a/ChangeLog b/ChangeLog index 8b9c55d..330e768 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-02-06 Dirk Mueller + reviewed by: plam + + * src/fcfs.c (FcFontSetUnserialize): + + Explain apples/oranges comparison and fix compilation error. + 2006-02-06 Dirk Mueller reviewed by: plam diff --git a/src/fcfs.c b/src/fcfs.c index 50049ba..cbb5dc7 100644 --- a/src/fcfs.c +++ b/src/fcfs.c @@ -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;