summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsha <mm.harsha@gmail.com>2010-12-25 16:34:56 +0100
committerWerner Lemberg <wl@gnu.org>2010-12-25 16:34:56 +0100
commit7774ac67ec562add4212930c82e402a7d7cdff8b (patch)
tree861373c4bbd9da212b805fe9f925557437a8a949
parent312d26a4915bcf7ca1e428f7bdf7ed631574dc13 (diff)
downloadfreetype2-7774ac67ec562add4212930c82e402a7d7cdff8b.tar.gz
Apply Savannah patch #7422.
If we encouter a space in a string then the sbit buffer is NULL, height and width are 0s. So the check in ftc_snode_compare will always pass for spaces (comparision with 255). Here the comments above the condition are proper but the implementation is not. When we create an snode I think it is the proper way to initialize the width to 255 and then put a check for being equal to 255 in snode compare function. * src/cache/ftcsbits.c (FTC_SNode_New): Initialize sbit widths with value 255. (ftc_snode_compare): Fix condition.
-rw-r--r--ChangeLog16
-rw-r--r--src/cache/ftcsbits.c7
2 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c9c1a52d..4f1641357 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2010-12-25 Harsha <mm.harsha@gmail.com>
+
+ Apply Savannah patch #7422.
+
+ If we encouter a space in a string then the sbit buffer is NULL,
+ height and width are 0s. So the check in ftc_snode_compare will
+ always pass for spaces (comparision with 255). Here the comments
+ above the condition are proper but the implementation is not. When
+ we create an snode I think it is the proper way to initialize the
+ width to 255 and then put a check for being equal to 255 in snode
+ compare function.
+
+ * src/cache/ftcsbits.c (FTC_SNode_New): Initialize sbit widths with
+ value 255.
+ (ftc_snode_compare): Fix condition.
+
2010-12-13 Werner Lemberg <wl@gnu.org>
Fix parameter handling of `FT_Set_Renderer'.
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 83245af1e..0386bdd6a 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -217,6 +217,7 @@
FTC_SFamilyClass clazz = FTC_CACHE__SFAMILY_CLASS( cache );
FT_UInt total;
+ FT_UInt node_count;
total = clazz->family_get_count( family, cache->manager );
@@ -239,6 +240,10 @@
FTC_GNode_Init( FTC_GNODE( snode ), start, family );
snode->count = count;
+ for ( node_count = 0; node_count < count; node_count++ )
+ {
+ snode->sbits[node_count].width = 255;
+ }
error = ftc_snode_load( snode,
cache->manager,
@@ -368,7 +373,7 @@
*
*/
- if ( sbit->buffer == NULL && sbit->width != 255 )
+ if ( sbit->buffer == NULL && sbit->width == 255 )
{
FT_ULong size;
FT_Error error;