gnuplot/gnuplot-4.6.1-xcopygc-sigsegv.patch
Peter Schiffer 2784edc475 - resolves: #759964
fixed sigsegv
2012-10-10 13:50:01 +02:00

34 lines
1.2 KiB
Diff

diff -upr gnuplot.orig/src/gplt_x11.c gnuplot/src/gplt_x11.c
--- gnuplot.orig/src/gplt_x11.c 2012-03-18 18:30:43.000000000 +0100
+++ gnuplot/src/gplt_x11.c 2012-08-17 15:11:31.888654269 +0200
@@ -2231,7 +2231,8 @@ exec_cmd(plot_struct *plot, char *comman
/* Load selected pattern or fill into a separate gc */
if (!fill_gc)
fill_gc = XCreateGC(dpy, plot->window, 0, 0);
- XCopyGC(dpy, *current_gc, ~0, fill_gc);
+ if (current_gc)
+ XCopyGC(dpy, *current_gc, ~0, fill_gc);
x11_setfill(&fill_gc, style);
/* gnuplot has origin at bottom left, but X uses top left
@@ -2560,7 +2561,8 @@ exec_cmd(plot_struct *plot, char *comman
/* Load selected pattern or fill into a separate gc */
if (!fill_gc)
fill_gc = XCreateGC(dpy, plot->window, 0, 0);
- XCopyGC(dpy, *current_gc, ~0, fill_gc);
+ if (current_gc)
+ XCopyGC(dpy, *current_gc, ~0, fill_gc);
x11_setfill(&fill_gc, style);
@@ -2668,7 +2670,8 @@ exec_cmd(plot_struct *plot, char *comman
/* Load selected pattern or fill into a separate gc */
if (!fill_gc)
fill_gc = XCreateGC(dpy, plot->window, 0, 0);
- XCopyGC(dpy, *current_gc, ~0, fill_gc);
+ if (current_gc)
+ XCopyGC(dpy, *current_gc, ~0, fill_gc);
x11_setfill(&fill_gc, style);