On Wednesday 24 January 2007 14:51, Ethan Merritt wrote:
> It turns out that this bug has already been found and fixed
> in the 4.3 CVS tree, but I did not realize that the fix also was
> needed for 4.2.
And here is a 4.2 version of the relevant patch. I've already
added it to the CVS branch for 4.2
--- gnuplot42/src/hidden3d.c 2006-03-17 07:36:26.000000000 -0800
+++ gnuplot/src/hidden3d.c 2006-12-28 10:25:50.000000000 -0800
@@ -926,9 +925,15 @@
max_crvlen = -1;
for (this_plot = plots, surface = 0;
- surface < pcount;
- this_plot = this_plot->next_sp, surface++) {
- long int crvlen = this_plot->iso_crvs->p_count;
+ surface < pcount;
+ this_plot = this_plot->next_sp, surface++) {
+ long int crvlen;
+
+ /* Quietly skip empty plots */
+ if (this_plot->plot_type == NODATA)
+ continue;
+
+ crvlen = this_plot->iso_crvs->p_count;
/* Allow individual plots to opt out of hidden3d calculations */
if (this_plot->opt_out_of_hidden3d)
@@ -997,6 +1002,10 @@
} /* switch */
} /* for (plots) */
+ /* Check for no data at all */
+ if (max_crvlen <= 0)
+ return;
+
/* allocate all the lists to the size we need: */
resize_dynarray(&vertices, nv);
resize_dynarray(&edges, ne);
@@ -1020,9 +1029,15 @@
for (this_plot = plots, surface = 0;
surface < pcount;
this_plot = this_plot->next_sp, surface++) {
- long int crvlen = this_plot->iso_crvs->p_count;
lp_style_type *lp_style = NULL;
TBOOLEAN color_from_column = this_plot->pm3d_color_from_column;
+ long int crvlen;
+
+ /* Quietly skip empty plots */
+ if (this_plot->plot_type == NODATA)
+ continue;
+
+ crvlen = this_plot->iso_crvs->p_count;
/* Allow individual plots to opt out of hidden3d calculations */
if (this_plot->opt_out_of_hidden3d)
|