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

Modified Files:
        px_win_common.c px_win_wmme.c 
Log Message:
Added and fixed a few error checks.

Index: px_win_wmme.c
===================================================================
RCS file: /cvsroot/audacity/lib-src/portmixer/src/px_win_wmme.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- px_win_wmme.c       2 Oct 2006 00:27:52 -0000       1.1
+++ px_win_wmme.c       5 Oct 2006 22:59:44 -0000       1.2
@@ -78,5 +78,5 @@
       return TRUE;
    }
 
-   return TRUE;
+   return FALSE;
 }

Index: px_win_common.c
===================================================================
RCS file: /cvsroot/audacity/lib-src/portmixer/src/px_win_common.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- px_win_common.c     2 Oct 2006 00:27:52 -0000       1.1
+++ px_win_common.c     5 Oct 2006 22:59:44 -0000       1.2
@@ -72,6 +72,10 @@
    PxInfo*info;
    MMRESULT res;
 
+   if (deviceIn == UINT_MAX && deviceOut == UINT_MAX) {
+      return FALSE;
+   }
+
    if (!initialize(Px)) {
       return FALSE;
    }
@@ -170,11 +174,11 @@
       if (ctrls == NULL) {
          break;
       }
-
-      for (s = 0; s < num; s++)
-      {
-         line.dwSource      = s;
-
+
+      for (s = 0; s < num; s++)
+      {
+         line.dwSource      = s;
+
          res = mixerGetLineInfo(mixer,
                                 &line,
                                 MIXER_GETLINEINFOF_SOURCE);
@@ -205,7 +209,11 @@
             ctrls[s].controlID = control.dwControlID;
          else
             ctrls[s].controlID = 0;
-      }
+      }
+
+      if (s != num) {
+         break;
+      }
 
       *pctrls = ctrls;
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to