Certain incantations of XDrawLines() can cause a server crash
Submitted by Trond Kjernasen
Assigned to Adam Jackson
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; int dash_len = 2; dashes = pen_width4; dashes = pen_width2; XSetDashes(dpy, gc, 0, dashes, dash_len);
XPoint points; points.x = 141; points.y = 40; points.x = 488; points.y = -160; points.x = 638; points.y = 100; points.x = 291; points.y = 300; points.x = 141; points.y = 40;
XDrawLines(dpy, drawable, gc, points, 5, CoordModeOrigin); XFreeGC(dpy, gc); ...
-- Best Regards, Trond Kjernaasen
Version: 7.3 (2007.09)