Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5139/src
Modified Files:
TrackArtist.cpp
Log Message:
Last attempt to correct referencing past end of array caused a drawing error.
Index: TrackArtist.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackArtist.cpp,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- TrackArtist.cpp 10 Apr 2009 06:36:17 -0000 1.144
+++ TrackArtist.cpp 20 Apr 2009 02:42:28 -0000 1.145
@@ -1877,7 +1877,7 @@
w1 = (sampleCount) ((t0*rate + (x+1) *rate *tstep) + .5);
if (!logF)
{
- for (int yy = 0; yy < mid.height - 1; yy++) {
+ for (int yy = 0; yy < mid.height; yy++) {
bool selflag = (ssel0 <= w0 && w1 < ssel1);
unsigned char rv, gv, bv;
float value;
@@ -1898,6 +1898,12 @@
value += freq[half * x + int (bin0)];
bin0 += 1.0;
}
+
+ // Do not reference past end of freq array.
+ if (int(bin1) >= mid.height) {
+ bin1 -= 1.0;
+ }
+
value += freq[half * x + int (bin1)] * (bin1 - int (bin1));
value /= binwidth;
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs