[pango-coverage] Fix optimization bug in pango_coverage_to_bytes()
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 10 Mar 2009 15:42:01 +0000 (11:42 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 13 Mar 2009 22:03:41 +0000 (18:03 -0400)
pango/pango-coverage.c

index 5b7ddad..7637117 100644 (file)
@@ -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;
+               }
            }
        }