diff options
author | malc <av1474@comtv.ru> | 2009-10-03 03:30:06 +0400 |
---|---|---|
committer | malc <av1474@comtv.ru> | 2009-10-03 03:30:18 +0400 |
commit | a628b869be2ff8a404b43029e3e56919ce2e3c29 (patch) | |
tree | ac00638f4d77aae6ea1af96fb70f5fb696d18ec6 /audio/ossaudio.c | |
parent | cbc18261ea62ade74c1c92cddf2a66701822ad59 (diff) |
oss/alsa: Do not invoke UB described in 7.15.1.1 (this time for ADC)
Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'audio/ossaudio.c')
-rw-r--r-- | audio/ossaudio.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c index dae25e93ab..4002f14670 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -781,20 +781,23 @@ static int oss_read (SWVoiceIn *sw, void *buf, int size) static int oss_ctl_in (HWVoiceIn *hw, int cmd, ...) { - va_list ap; - int poll_mode; OSSVoiceIn *oss = (OSSVoiceIn *) hw; - va_start (ap, cmd); - poll_mode = va_arg (ap, int); - va_end (ap); - switch (cmd) { case VOICE_ENABLE: - if (poll_mode && oss_poll_in (hw)) { - poll_mode = 0; + { + va_list ap; + int poll_mode; + + va_start (ap, cmd); + poll_mode = va_arg (ap, int); + va_end (ap); + + if (poll_mode && oss_poll_in (hw)) { + poll_mode = 0; + } + hw->poll_mode = poll_mode; } - hw->poll_mode = poll_mode; break; case VOICE_DISABLE: |