Index: src/hg/hgTracks/bamTrack.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/bamTrack.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -b -B -U 4 -r1.14 -r1.15
--- src/hg/hgTracks/bamTrack.c	3 Nov 2009 00:26:33 -0000	1.14
+++ src/hg/hgTracks/bamTrack.c	17 Nov 2009 18:03:55 -0000	1.15
@@ -461,8 +461,10 @@
     innerLine(hvg, x1, midY, w, color);
 for (sf = lf->components; sf != NULL; sf = sf->next)
     {
     int s = sf->start,  e = sf->end;
+    if (e <= s || e < winStart || s > winEnd)
+	continue;
     if (baseQualMode)
 	color = tg->colorShades[sf->grayIx];
     baseColorDrawItem(tg, lf, sf->grayIx, hvg, xOff, y, scale, font, s, e, heightPer,
 		      zoomedToCodonLevel, mrnaSeq, sf, psl, drawOpt, MAXPIXELS, winStart, color);

