qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Volker Rümelin" <vr_qemu@t-online.de>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: QEMU <qemu-devel@nongnu.org>, "Zoltán Kővágó" <dirty.ice.hu@gmail.com>
Subject: [PATCH 4/9] audio: prevent SIGSEGV in AUD_get_buffer_size_out
Date: Thu, 23 Jan 2020 08:49:38 +0100	[thread overview]
Message-ID: <20200123074943.6699-4-vr_qemu@t-online.de> (raw)
In-Reply-To: <1e29e1d3-b59b-fcd6-cdff-a680bcdbffa4@t-online.de>

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>
---
 audio/audio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/audio/audio.c b/audio/audio.c
index bf0f01e17f..922e95011c 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -878,9 +878,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)
-- 
2.16.4



  parent reply	other threads:[~2020-01-23  7:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23  7:41 [PATCH 0/9] more audio fixes and improvements Volker Rümelin
2020-01-23  7:49 ` [PATCH 1/9] audio: fix audio_generic_write Volker Rümelin
2020-01-23  7:49 ` [PATCH 2/9] audio: fix audio_generic_read Volker Rümelin
2020-01-23  7:49 ` [PATCH 3/9] paaudio: remove unused variables Volker Rümelin
2020-01-23  7:49 ` Volker Rümelin [this message]
2020-01-23  7:49 ` [PATCH 5/9] audio: fix bug 1858488 Volker Rümelin
2020-01-23  7:49 ` [PATCH 6/9] ossaudio: prevent SIGSEGV in oss_enable_out Volker Rümelin
2020-01-23  7:49 ` [PATCH 7/9] ossaudio: prevent SIGPFE in oss_write Volker Rümelin
2020-01-23  7:49 ` [PATCH 8/9] ossaudio: disable poll mode can't be reached Volker Rümelin
2020-01-23  7:49 ` [PATCH 9/9] audio: audio_generic_get_buffer_in should honor *size Volker Rümelin
2020-01-27  6:45 ` [PATCH 0/9] more audio fixes and improvements Mark Cave-Ayland
2020-01-27 20:40   ` Volker Rümelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200123074943.6699-4-vr_qemu@t-online.de \
    --to=vr_qemu@t-online.de \
    --cc=dirty.ice.hu@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).