From nobody Tue Feb 10 18:54:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579766142; cv=none; d=zohomail.com; s=zohoarc; b=ELUxNdVb+tHwvCX+CfuM/5C6HjxqbynMvL7ajRF3VFkfKDveeJj6afSMnHh9ykjkIK1OahZ5kmmOjs3Lk0y0/FuCVIVgHflx2K42j746ay3ys8QZxpu1hpSjAA8N1eY0oDamkpzbzV81MRLZuPHzieDmo463z3SqcHXMBnCl9yk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579766142; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g1rfnDyadcIIqE/4wKYFcGaFKJVqShK8rcuIorkwRPI=; b=MrqbFNG7YPG8sk8A3OsIiUyMGT5cILIopNBRrZU2GOJd9ED7ApgxAhhk3rD94lC4PteoBYX/bMauoZjn5mR0+X13zJBntalZknNwGwMphtGMxlQAbIAxywoCkei/2mDWoy5zYmK0vAcHS5CGM+U26lGsR1TordfDJJvX3gJm9Iw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579766142674643.7955785812037; Wed, 22 Jan 2020 23:55:42 -0800 (PST) Received: from localhost ([::1]:52428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuXL3-0004bO-Dy for importer@patchew.org; Thu, 23 Jan 2020 02:55:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46135) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuXFa-0005yF-Fg for qemu-devel@nongnu.org; Thu, 23 Jan 2020 02:50:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuXFZ-0004fu-G8 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 02:50:02 -0500 Received: from mailout10.t-online.de ([194.25.134.21]:51690) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iuXFZ-0004cw-9s for qemu-devel@nongnu.org; Thu, 23 Jan 2020 02:50:01 -0500 Received: from fwd10.aul.t-online.de (fwd10.aul.t-online.de [172.20.26.152]) by mailout10.t-online.de (Postfix) with SMTP id 67E89415E823; Thu, 23 Jan 2020 08:49:58 +0100 (CET) Received: from linpower.localnet (TlKvyEZTYhur9DAPGEYWKidjGj6J0KObIIHEdW-kC4SbcWks057M-zzpxngbDOSZgo@[46.86.62.122]) by fwd10.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1iuXFP-1KaRhg0; Thu, 23 Jan 2020 08:49:51 +0100 Received: by linpower.localnet (Postfix, from userid 1000) id 58C6A200F54; Thu, 23 Jan 2020 08:49:43 +0100 (CET) From: =?UTF-8?q?Volker=20R=C3=BCmelin?= To: Gerd Hoffmann Subject: [PATCH 4/9] audio: prevent SIGSEGV in AUD_get_buffer_size_out Date: Thu, 23 Jan 2020 08:49:38 +0100 Message-Id: <20200123074943.6699-4-vr_qemu@t-online.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <1e29e1d3-b59b-fcd6-cdff-a680bcdbffa4@t-online.de> References: <1e29e1d3-b59b-fcd6-cdff-a680bcdbffa4@t-online.de> MIME-Version: 1.0 X-ID: TlKvyEZTYhur9DAPGEYWKidjGj6J0KObIIHEdW-kC4SbcWks057M-zzpxngbDOSZgo X-TOI-MSGID: 8551bd31-6fca-49ca-a085-88876a6ea7fb Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 194.25.134.21 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU , =?UTF-8?q?Zolt=C3=A1n=20K=C5=91v=C3=A1g=C3=B3?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" With audiodev parameter out.mixing-engine=3Doff 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=3Daudio0,out.mixing-engine=3Doff Signed-off-by: Volker R=C3=BCmelin --- 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) } } =20 -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; } =20 void AUD_set_active_out (SWVoiceOut *sw, int on) --=20 2.16.4