goffice r2233 - in trunk: . plugins/plot_surface



Author: jbrefort
Date: Fri Oct 10 09:17:15 2008
New Revision: 2233
URL: http://svn.gnome.org/viewvc/goffice?rev=2233&view=rev

Log:
2008-10-10  Jean Brefort  <jean brefort normalesup org>

	* plugins/plot_surface/gog-contour.c: (gog_contour_view_render): do
	not try to access NULL data. [#555757]
	* plugins/plot_surface/gog-surface.c: (gog_surface_view_render): ditto.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/plugins/plot_surface/gog-contour.c
   trunk/plugins/plot_surface/gog-surface.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Fri Oct 10 09:17:15 2008
@@ -7,6 +7,7 @@
 Jean:
 	* Implement probability plots for some common distributions. [#500168]
 	* Fix invalid write in gog_probability_plot_series_update. [#555161]
+	* Fix Null pointer crash in gog_contour_view_render. [#555757]
 
 Jody:
 	* Patch foocanvas to work around behaviour change in gtk 2.14.

Modified: trunk/plugins/plot_surface/gog-contour.c
==============================================================================
--- trunk/plugins/plot_surface/gog-contour.c	(original)
+++ trunk/plugins/plot_surface/gog-contour.c	Fri Oct 10 09:17:15 2008
@@ -281,6 +281,13 @@
 	if (imax ==0 || jmax == 0)
 		return;
 
+	if (plot->plotted_data)
+		data = plot->plotted_data;
+	else
+		data = gog_xyz_plot_build_matrix (plot, &cw);
+	if (data == NULL)
+		return;
+
 	x_map = gog_axis_map_new (plot->base.axis[0], 
 				  view->residual.x , view->residual.w);
 	y_map = gog_axis_map_new (plot->base.axis[1], 
@@ -294,11 +301,6 @@
 		return;
 	}
 
-	if (plot->plotted_data)
-		data = plot->plotted_data;
-	else
-		data = gog_xyz_plot_build_matrix (plot, &cw);
-
 	/* Set cw to ensure that polygons will allways be drawn clockwise */
 	xdiscrete = gog_axis_is_discrete (plot->base.axis[0]) ||
 			series->values[(plot->transposed)? 1: 0].data == NULL;

Modified: trunk/plugins/plot_surface/gog-surface.c
==============================================================================
--- trunk/plugins/plot_surface/gog-surface.c	(original)
+++ trunk/plugins/plot_surface/gog-surface.c	Fri Oct 10 09:17:15 2008
@@ -150,6 +150,14 @@
 	if (imax ==0 || jmax == 0)
 		return;
 	area = gog_chart_view_get_plot_area (view->parent);
+
+	if (plot->plotted_data)
+		data = plot->plotted_data;
+	else
+		data = gog_xyz_plot_build_matrix (plot, &cw);
+	if (data == NULL)
+		return;
+
 	chart_map = gog_chart_map_3d_new (chart, area,
 				       GOG_PLOT (plot)->axis[GOG_AXIS_X],
 				       GOG_PLOT (plot)->axis[GOG_AXIS_Y],
@@ -162,11 +170,6 @@
 
 	style = gog_styled_object_get_style (GOG_STYLED_OBJECT (series));
 
-	if (plot->plotted_data)
-		data = plot->plotted_data;
-	else
-		data = gog_xyz_plot_build_matrix (plot, &cw);
-
 	/* Build the tiles list */
 	x_vec = gog_xyz_plot_get_x_vals (plot);
 	y_vec = gog_xyz_plot_get_y_vals (plot);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]