Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv26647

Modified Files:
        ShuttleGui.cpp 
Log Message:
Fix a couple of assertions if no devices available.

Index: ShuttleGui.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/ShuttleGui.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- ShuttleGui.cpp      10 Jul 2006 13:37:23 -0000      1.22
+++ ShuttleGui.cpp      7 Sep 2006 04:04:44 -0000       1.23
@@ -1005,7 +1005,10 @@
          else
          {
             wxString Temp;
-            Temp = (*pChoices)[WrappedRef.ReadAsInt()];
+            if( pChoices && ( WrappedRef.ReadAsInt() < pChoices->GetCount() ) )
+            {
+               Temp = (*pChoices)[WrappedRef.ReadAsInt()];
+            }
             pChoice = AddChoice( Prompt, Temp, pChoices );
          }
       }
@@ -1191,12 +1194,16 @@
    if( n== wxNOT_FOUND )
       n=miNoMatchSelector;
    miNoMatchSelector = 0;
-   return Choices[n];
+   if( n < Choices.GetCount() )
+   {
+      return Choices[n];
+   }
+   return wxT("");
 }
 
 /// Int-to-Index (choices can be items like e.g 0x400120 )
 int ShuttleGuiBase::TranslateToIndex( const int Value, const wxArrayInt 
&Choices )
-{
+{  
    int n = Choices.Index( Value );
    if( n== wxNOT_FOUND )
       n=miNoMatchSelector;
@@ -1211,7 +1218,11 @@
    if( n== wxNOT_FOUND )
       n=miNoMatchSelector;
    miNoMatchSelector = 0;
-   return Choices[n];
+   if( n < Choices.GetCount() )
+   {
+      return Choices[n];
+   }
+   return 0;
 }
 
 //-----------------------------------------------------------------------//


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to