[xiph-commits] r12078 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Fri Nov 10 16:28:46 PST 2006


Author: xiphmont
Date: 2006-11-10 16:28:45 -0800 (Fri, 10 Nov 2006)
New Revision: 12078

Modified:
   trunk/sushivision/panel-2d.c
Log:
Correct segfault in legend code if crosshairs temporarily go off-graph or into an area where the data rectangle has not yet been reallocated.



Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2006-11-11 00:12:28 UTC (rev 12077)
+++ trunk/sushivision/panel-2d.c	2006-11-11 00:28:45 UTC (rev 12078)
@@ -163,7 +163,8 @@
     for(i=0;i<p->objectives;i++){
       float val=NAN;
 
-      if(p2->data_rect && p2->data_rect[i])
+      if(p2->data_rect && p2->data_rect[i] &&
+	 x<w && y<h )
 	val = p2->data_rect[i][y*w+x];
 
       if(!isnan(val) && val >= p2->alphadel[i]){
@@ -1098,6 +1099,15 @@
   panel2d_undo_resume(p);
 }
 
+static void panel2d_find_peak(sushiv_panel_t *p){
+  sushiv_panel2d_t *p2 = (sushiv_panel2d_t *)p->internal;
+
+  // finds in order each peak (in the event there's more than one) of
+  // each active objective
+
+
+}
+
 static gboolean panel2d_keypress(GtkWidget *widget,
 				 GdkEventKey *event,
 				 gpointer in){
@@ -1129,7 +1139,7 @@
 
   case GDK_p:
     // find [next] peak
-    //panel2d_peak_find(p);
+    panel2d_find_peak(p);
     return TRUE;
   }
 



More information about the commits mailing list