[xiph-commits] r18414 - trunk/spectrum

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Tue Jun 19 21:10:37 PDT 2012


Author: xiphmont
Date: 2012-06-19 21:10:37 -0700 (Tue, 19 Jun 2012)
New Revision: 18414

Modified:
   trunk/spectrum/spec_plot.c
Log:
Guard gdk_draw_line; although it takes gint, it doesn't guard against overflowing the 16 bit x/y fields in X.



Modified: trunk/spectrum/spec_plot.c
===================================================================
--- trunk/spectrum/spec_plot.c	2012-06-20 01:38:18 UTC (rev 18413)
+++ trunk/spectrum/spec_plot.c	2012-06-20 04:10:37 UTC (rev 18414)
@@ -45,7 +45,7 @@
 
 static GtkDrawingAreaClass *parent_class = NULL;
 
-#define PHAX_MIN 6
+#define PHAX_MIN 8
 
 static void compute_xgrid(Plot *p, fetchdata *f){
   if(p->maxrate!=f->maxrate ||
@@ -550,6 +550,11 @@
 
               }
 
+              if(ymin>32767)ymin=32767;
+              if(ymax>32767)ymax=32767;
+              if(ymin<-32768)ymin=-32768;
+              if(ymax<-32768)ymax=-32768;
+
               gdk_draw_line(p->backing,p->drawgc,padx+i,ymin,padx+i,ymax);
             }
           }



More information about the commits mailing list