From: Søren Sandmann Pedersen <[email protected]>

glyph-test would sometimes set a solid image as an alpha map, which is
not allowed. When this happened and the debug spew was enabled,
messages like this one would be generated:

    *** BUG ***
    In pixman_image_set_alpha_map: The expression
            !alpha_map || alpha_map->type == BITS was false
    Set a breakpoint on '_pixman_log_error' to debug

Fix this by not passing the ALLOW_SOLID flag to create_image() when
the resulting is to be used as an alpha map.
---
 test/glyph-test.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/glyph-test.c b/test/glyph-test.c
index 0fb6641..84de5aa 100644
--- a/test/glyph-test.c
+++ b/test/glyph-test.c
@@ -199,7 +199,7 @@ create_image (int max_size, const pixman_format_code_t 
*formats, uint32_t flags)
        alpha_x = lcg_rand_n (width);
        alpha_y = lcg_rand_n (height);
        alpha_map =
-           create_image (max_size, formats, (flags & ~ALLOW_ALPHA_MAP));
+           create_image (max_size, formats, (flags & ~(ALLOW_ALPHA_MAP | 
ALLOW_SOLID)));
        pixman_image_set_alpha_map (image, alpha_map, alpha_x, alpha_y);
        pixman_image_unref (alpha_map);
     }
@@ -330,6 +330,6 @@ int
 main (int argc, const char *argv[])
 {
     return fuzzer_test_main ("glyph", 30000,
-                            0x1B7696A2,
+                            0x741CB2DB,
                             test_glyphs, argc, argv);
 }
-- 
1.7.4

_______________________________________________
Pixman mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to