alsa: avoid uninitialized read
authorTristan Matthews <le.businessman@gmail.com>
Sun, 2 Nov 2014 04:52:14 +0000 (00:52 -0400)
committerTristan Matthews <le.businessman@gmail.com>
Sun, 2 Nov 2014 04:52:48 +0000 (00:52 -0400)
The check if ( subdevice != -1 ) was being done on a potentially
uninitialized variable.

RtAudio.cpp

index af7d205a1977491c39e76b85affb3fc8dc332807..7bc009d1df58a4fe28a787416025d8c23e426c6d 100644 (file)
@@ -6815,6 +6815,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
 \r
   // Count cards and devices\r
   card = -1;\r
+  subdevice = -1;\r
   snd_card_next( &card );\r
   while ( card >= 0 ) {\r
     sprintf( name, "hw:%d", card );\r