From df0a0b82f03f802f076ed5129d2c73728d373bf9 Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Wed, 13 Aug 2014 11:24:51 +0200 Subject: [PATCH] Bug 81699: Segfault sweep_line_delete on video playback (2) test case useful to remove webkit from the list of suspects. On linux x86_64 running: CAIRO_TEST_TARGET=xlib gdb --args test/.libs/cairo-test-suite sweep-line-delete produces a crash and a backtrace similar (shorter) to that in the bug report. --- test/Makefile.sources | 1 + test/sweep-line-delete.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 test/sweep-line-delete.c diff --git a/test/Makefile.sources b/test/Makefile.sources index 916d91a..ab5d6f6 100644 --- a/test/Makefile.sources +++ b/test/Makefile.sources @@ -342,6 +342,7 @@ test_sources = \ surface-pattern-scale-down.c \ surface-pattern-scale-down-extend.c \ surface-pattern-scale-up.c \ + sweep-line-delete.c \ text-antialias.c \ text-antialias-subpixel.c \ text-cache-crash.c \ diff --git a/test/sweep-line-delete.c b/test/sweep-line-delete.c new file mode 100644 index 0000000..a16e0e2 --- /dev/null +++ b/test/sweep-line-delete.c @@ -0,0 +1,40 @@ +#include "cairo-test.h" + +static cairo_test_status_t +draw (cairo_t *cr, int w, int h) +{ + const cairo_matrix_t transform = {0.0848671, 0, 0, 0.0848671, 39.907812, 5.608896}; + + cairo_transform (cr, &transform); + + cairo_move_to (cr, 8, 0); + cairo_curve_to (cr, 12.417969, 0, 16, 3.582031, 16, 8); + cairo_curve_to (cr, 16, 12.417969, 12.417969, 16, 8, 16); + cairo_curve_to (cr, 3.582031, 16, 0, 12.417969, 0, 8); + cairo_curve_to (cr, 0, 3.582031, 3.582031, 0, 8, 0); + cairo_close_path (cr); + + cairo_clip (cr); + + cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); + cairo_move_to (cr, 16, 0); + cairo_line_to (cr, 8, 8); + cairo_line_to (cr, 16, 16); + cairo_close_path (cr); + + cairo_clip (cr); + + cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT); + + cairo_rectangle (cr, 0, 0, 16, 16); + cairo_fill (cr); + + return CAIRO_TEST_SUCCESS; +} + +CAIRO_TEST (sweep_line_delete, + "triggers sweep_line_delete crash", + "sweep_line_delete", /* keywords */ + NULL, /* requirements */ + 800, 600, + NULL, draw) -- 1.9.3