Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29654

Modified Files:
        LabelTrack.cpp LabelTrack.h 
Log Message:

Fix uninitialized memory references


Index: LabelTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/LabelTrack.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- LabelTrack.cpp      16 May 2009 11:13:12 -0000      1.103
+++ LabelTrack.cpp      25 May 2009 11:13:01 -0000      1.104
@@ -82,6 +82,9 @@
 
 LabelTrack::LabelTrack(DirManager * projDirManager):
    Track(projDirManager),
+   mbHitCenter(false),
+   mOldEdge(-1),
+   mSelIndex(-1),
    mMouseOverLabelLeft(-1),
    mMouseOverLabelRight(-1),
    mIsAdjustingLabel(false)
@@ -89,14 +92,13 @@
    SetDefaultName(_NoAcc("&Label Track"));
    SetName(GetDefaultName());
 
-   ResetFont();
-
    // Label tracks are narrow
    // Default is to allow two rows so that new users get the
    // idea that labels can 'stack' when they would overlap.
-   mHeight = 73;     
+   SetHeight(73);
+
+   ResetFont();
    CreateCustomGlyphs();
-   mSelIndex = -1;
 
    // reset flags
    ResetFlags();
@@ -104,6 +106,9 @@
 
 LabelTrack::LabelTrack(const LabelTrack &orig) :
    Track(orig),
+   mbHitCenter(false),
+   mOldEdge(-1),
+   mSelIndex(-1),
    mMouseOverLabelLeft(-1),
    mMouseOverLabelRight(-1),
    mIsAdjustingLabel(false)
@@ -208,7 +213,10 @@
 void LabelTrack::ResetFlags()
 {
    mMouseXPos = -1;
+   mXPos1 = -1;
+   mXPos2 = -1;
    mDragXPos = -1;
+   mInitialCursorPos = 1;
    mCurrentCursorPos = 1;
    mResetCursorPos = false;
    mRightDragging = false;
@@ -449,10 +457,18 @@
    }
 }
 
-LabelStruct::LabelStruct() {
+LabelStruct::LabelStruct()
+{
    changeInitialMouseXPos = true;
    highlighted = false;
    updated = false;
+   t = 0.0;
+   t1 = 0.0;
+   width = 0;
+   x = 0;
+   x1 = 0;
+   xText = 0;
+   y = 0;
 }
 
 /// Draw vertical lines that go exactly through the position
@@ -1864,10 +1880,10 @@
          }
          else if (!wxStrcmp(attr, wxT("height")) && 
                   XMLValueChecker::IsGoodInt(strValue) && 
strValue.ToLong(&nValue))
-            mHeight = nValue;
+            SetHeight(nValue);
          else if (!wxStrcmp(attr, wxT("minimized")) && 
                   XMLValueChecker::IsGoodInt(strValue) && 
strValue.ToLong(&nValue))
-            mMinimized = (nValue != 0);
+            SetMinimized(nValue != 0);
       }
 
       return true;

Index: LabelTrack.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/LabelTrack.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- LabelTrack.h        16 May 2009 11:13:12 -0000      1.46
+++ LabelTrack.h        25 May 2009 11:13:01 -0000      1.47
@@ -173,7 +173,7 @@
    double AdjustTimeStampForSpeedChange(double t, double b, double e, double 
change);
 
  public:
-        void SortLabels();
+   void SortLabels();
    //These two are used by a TrackPanel KLUDGE, which is why they are public.
    bool mbHitCenter;
    //The edge variable tells us what state the icon is in.


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to