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

Modified Files:
        Menus.cpp 
Log Message:
Prevent crash when you attempt to paste into a wave track with no audio.  Crude 
but effective!

Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.436
retrieving revision 1.437
diff -u -d -r1.436 -r1.437
--- Menus.cpp   6 Feb 2009 00:43:40 -0000       1.436
+++ Menus.cpp   6 Feb 2009 00:50:58 -0000       1.437
@@ -2944,6 +2944,7 @@
 
    int numSelected =0;
 
+   // Pastes text into the first label track or counts selected wave tracks
    while (countTrack) {
       if (countTrack->GetSelected()) {
          if (countTrack->GetKind() == Track::Label) {
@@ -2970,6 +2971,8 @@
    if (numSelected == 0) {
       TrackListIterator clipIter(msClipboard);
       Track *c = clipIter.First();
+      if(c == NULL)  // if there is no audio to paste...
+         return;
       Track *n;
       Track *f = NULL;
 
@@ -3043,6 +3046,8 @@
 
    Track *n = iter.First();
    Track *c = clipIter.First();
+   if(c == NULL)    // if there is no audio to paste...
+      return;
    Track *f = NULL;
    Track *tmpSrc = NULL;
    Track *tmpC = NULL;


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to