summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-03-10 11:42:01 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-03-13 18:03:41 -0400
commited941ddf131cbdd8f5e1e1efabd6e92c37010735 (patch)
treeaa0d49ab6dd9a2a51937f159da475975050ebed6
parentfa908f4cb6db943b555a51d1ce4bf01112b1a710 (diff)
downloadpango-ed941ddf131cbdd8f5e1e1efabd6e92c37010735.tar.gz
[pango-coverage] Fix optimization bug in pango_coverage_to_bytes()
-rw-r--r--pango/pango-coverage.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/pango/pango-coverage.c b/pango/pango-coverage.c
index 5b7ddada..7637117d 100644
--- a/pango/pango-coverage.c
+++ b/pango/pango-coverage.c
@@ -392,15 +392,18 @@ pango_coverage_to_bytes (PangoCoverage *coverage,
guchar *data = coverage->blocks[i].data;
guchar first_val = data[0];
- for (j = 1 ; j < 64; j++)
- if (data[j] != first_val)
- break;
-
- if (j == 64)
+ if (first_val == 0 || first_val == 0xff)
{
- g_slice_free1 (64, data);
- coverage->blocks[i].data = NULL;
- coverage->blocks[i].level = first_val & 0x3;
+ for (j = 1 ; j < 64; j++)
+ if (data[j] != first_val)
+ break;
+
+ if (j == 64)
+ {
+ g_slice_free1 (64, data);
+ coverage->blocks[i].data = NULL;
+ coverage->blocks[i].level = first_val & 0x3;
+ }
}
}