[xiph-commits] r12930 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Tue May 8 04:37:31 PDT 2007


Author: xiphmont
Date: 2007-05-08 04:37:30 -0700 (Tue, 08 May 2007)
New Revision: 12930

Modified:
   trunk/sushivision/dimension.c
   trunk/sushivision/panel-1d.c
Log:
Correct a crash bug due to calling dim callback on wrong panel

Change 1d panels to not allocate working space off stack when rerendering graphs


Modified: trunk/sushivision/dimension.c
===================================================================
--- trunk/sushivision/dimension.c	2007-05-08 08:22:19 UTC (rev 12929)
+++ trunk/sushivision/dimension.c	2007-05-08 11:37:30 UTC (rev 12930)
@@ -259,7 +259,7 @@
     /* dims can be shared amongst multiple widgets; all must get callbacks */
     for(i=0;i<d->private->widgets;i++){
       _sv_dim_widget_t *w = d->private->widget_list[i];
-      w->center_callback(dw->dl);
+      w->center_callback(d->private->widget_list[i]->dl);
     }
 
     if(d->private->value_callback) 

Modified: trunk/sushivision/panel-1d.c
===================================================================
--- trunk/sushivision/panel-1d.c	2007-05-08 08:22:19 UTC (rev 12929)
+++ trunk/sushivision/panel-1d.c	2007-05-08 11:37:30 UTC (rev 12930)
@@ -144,11 +144,11 @@
 	int pointtype = p1->pointtype[j];
 	u_int32_t color = _sv_mapping_calc(p1->mappings+j,1.,0);
       
-	double xv[dw];
-	double yv[dw];
-	double data_vec[dw];
+	double *xv = calloc(dw,sizeof(*xv));
+	double *yv = calloc(dw,sizeof(*yv));
+	double *data_vec = calloc(dw,sizeof(*data_vec));
 	
-	memcpy(data_vec,p1->data_vec[j],sizeof(data_vec));
+	memcpy(data_vec,p1->data_vec[j],sizeof(*data_vec)*dw);
 	gdk_threads_leave();
 
 	/* by x */
@@ -337,6 +337,10 @@
 	  }
 	}
 	
+	free(data_vec);
+	free(xv);
+	free(yv);
+
 	gdk_threads_enter();
 	if(plot_serialno != p->private->plot_serialno ||
 	   map_serialno != p->private->map_serialno) return -1;



More information about the commits mailing list