hdspmixer: Fix ALSA snd_ctl_open error when running with three cards.

If three (or more) RME cards are installed in one box, hdspmixer will
try to open a non-existing 4th card, causing an error in snd_ctl_open
and finally terminates itself.

cards[] is a static array, and one must not read beyond the last
element. The solution is far from elegant, however, it's a rather
unintrusive change.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Adrian Knoth 2011-02-24 21:33:30 +01:00 committed by Takashi Iwai
parent 3506d3d9a7
commit 97e96addff
3 changed files with 9 additions and 7 deletions

View file

@ -47,6 +47,8 @@
#define PAN_WIDTH 28
#define MAX_CARDS 3
typedef unsigned long long int int64;
#endif