[PULL,07/12] ossaudio: prevent SIGSEGV in oss_enable_out
diff mbox series

Message ID 20200207074557.26073-8-kraxel@redhat.com
State New
Headers show
Series
  • [PULL,01/12] audio/oss: fix buffer pos calculation
Related show

Commit Message

Gerd Hoffmann Feb. 7, 2020, 7:45 a.m. UTC
From: Volker RĂ¼melin <vr_qemu@t-online.de>

With audiodev parameter out.mixing-engine=off hw->mix_buf is
NULL. This patch reverts a small part of dc88e38fa7 "audio:
unify input and output mixeng buffer management".

To reproduce the problem start qemu with
-audiodev oss,id=audio0,try-mmap=on,out.mixing-engine=off

Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de>
Message-Id: <20200123074943.6699-6-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/ossaudio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 576b5b5b2021..39a6fc09e5df 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -592,7 +592,7 @@  static void oss_enable_out(HWVoiceOut *hw, bool enable)
             return;
         }
 
-        audio_pcm_info_clear_buf(&hw->info, hw->buf_emul, hw->mix_buf->size);
+        audio_pcm_info_clear_buf(&hw->info, hw->buf_emul, hw->samples);
         trig = PCM_ENABLE_OUTPUT;
         if (ioctl(oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {
             oss_logerr(errno,