WIN32: Fix invalid array accesses when MIDI device listing fails.

This commit is contained in:
Johannes Schickel 2016-03-01 01:13:55 +01:00
parent e317958d4c
commit 1f217e3834

View File

@ -185,6 +185,9 @@ MusicDevices WindowsMusicPlugin::getDevices() const {
deviceNames.push_back(tmp.szPname);
}
// Limit us to the number of actually retrieved devices.
numDevs = deviceNames.size();
// Check for non-unique device names. This may happen if someone has devices with identical
// names (e. g. more than one USB device of the exact same hardware type). It seems that this
// does happen in reality sometimes. We generate index numbers for these devices.