diff options
author | Volker RĂ¼melin <vr_qemu@t-online.de> | 2020-01-23 08:49:38 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-31 08:48:03 +0100 |
commit | 69ac07863205ec281bcd2f2e6571202da0c315f7 (patch) | |
tree | 9dc45f16d9187eca497534a1baaaab89923f9fe8 /audio | |
parent | a76e6b8794727ae777e33856e1ccd2b410d0bde2 (diff) |
audio: prevent SIGSEGV in AUD_get_buffer_size_out
With audiodev parameter out.mixing-engine=off hw->mix_buf is
NULL. This leads to a segmentation fault in
AUD_get_buffer_size_out. This patch reverts a small part of
dc88e38fa7 "audio: unify input and output mixeng buffer
management".
To reproduce the problem start qemu with
-soundhw adlib -audiodev pa,id=audio0,out.mixing-engine=off
Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de>
Message-Id: <20200123074943.6699-4-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/audio.c b/audio/audio.c index 9cd76a331d..12ed318813 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -879,9 +879,9 @@ size_t AUD_read(SWVoiceIn *sw, void *buf, size_t size) } } -int AUD_get_buffer_size_out (SWVoiceOut *sw) +int AUD_get_buffer_size_out(SWVoiceOut *sw) { - return sw->hw->mix_buf->size * sw->hw->info.bytes_per_frame; + return sw->hw->samples * sw->hw->info.bytes_per_frame; } void AUD_set_active_out (SWVoiceOut *sw, int on) |