Certain incantations of XDrawLines() can cause a server crash
Submitted by Trond Kjernasen
Assigned to Adam Jackson @ajax
Description
Hi,
I've come across what appears to be a bug in X.Org's implementation of XDrawLines(), which results in a server crash. It seems related to the cap style and join style that is used, since changing it to the join style to JoinMiter and cap style to CapButt makes it works as expected.
The following code can be used to reproduce the crash:
... int pen_width = 50; XGCValues vals; vals.line_width = pen_width; vals.line_style = LineOnOffDash; vals.join_style = JoinBevel; vals.cap_style = CapProjecting; GC gc = XCreateGC(dpy, drawable, GCLineWidth | GCLineStyle | GCJoinStyle | GCCapStyle, &vals);
char dashes[2]; int dash_len = 2; dashes[0] = pen_width4; dashes[1] = pen_width2; XSetDashes(dpy, gc, 0, dashes, dash_len);
XPoint points[5]; points[0].x = 141; points[0].y = 40; points[1].x = 488; points[1].y = -160; points[2].x = 638; points[2].y = 100; points[3].x = 291; points[3].y = 300; points[4].x = 141; points[4].y = 40;
XDrawLines(dpy, drawable, gc, points, 5, CoordModeOrigin); XFreeGC(dpy, gc); ...
-- Best Regards, Trond Kjernaasen
Version: 7.3 (2007.09)