[xiph-commits] r12129 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Fri Nov 17 09:22:54 PST 2006


Author: xiphmont
Date: 2006-11-17 09:22:52 -0800 (Fri, 17 Nov 2006)
New Revision: 12129

Modified:
   trunk/sushivision/Makefile
   trunk/sushivision/panel-2d.c
Log:
Eliminate segfault caused when multiple undos are processed resulting
in crosshairs temporarily off the screen (value lookup in
update_legend may underflow the array)
 


Modified: trunk/sushivision/Makefile
===================================================================
--- trunk/sushivision/Makefile	2006-11-17 16:46:52 UTC (rev 12128)
+++ trunk/sushivision/Makefile	2006-11-17 17:22:52 UTC (rev 12129)
@@ -27,8 +27,8 @@
 
 all:    
 	pkg-config --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null
-	$(MAKE) target CFLAGS='-O2 $(SOCFLAGS) $(GCF) $(ADD_DEF)'
-	$(MAKE) examples CFLAGS='-O2 $(GCF) $(ADD_DEF)'
+	$(MAKE) target CFLAGS='-O2 -g $(SOCFLAGS) $(GCF) $(ADD_DEF)'
+	$(MAKE) examples CFLAGS='-O2 -g $(GCF) $(ADD_DEF)'
 
 debug:
 	pkg-config --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null

Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2006-11-17 16:46:52 UTC (rev 12128)
+++ trunk/sushivision/panel-2d.c	2006-11-17 17:22:52 UTC (rev 12129)
@@ -166,7 +166,8 @@
       float val=NAN;
 
       if(p2->data_rect && p2->data_rect[i] &&
-	 x<w && y<h )
+	 x<w && x>0 &&
+	 y<h && y>0 )
 	val = p2->data_rect[i][y*w+x];
 
       if(!isnan(val) && val >= p2->alphadel[i]){



More information about the commits mailing list