alsa/0016-pcm-Remove-assert-from-snd_pcm_hw_params_slave.patch
Takashi Iwai e8e74453bd Accepting request 308371 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes: UCM updates, Broadwell UCM support,
  namehint fixes, fix faulty assert in PCM plugins, etc:
  0001-ucm-document-some-standard-values.patch
  0002-conf-ucm-broadwell-rt286-add-ucm-config.patch
  0003-conf-ucm-Add-Makefile.am-for-broadwell-rt286-ucm-con.patch
  0004-ucm-reformat-snd_use_case_get-doc.patch
  0005-ucm-improve-jack-configuration-documentation.patch
  0006-USB-audio-Sound-Blaster-HD-iec958-is-on-device-1.patch
  0007-Sync-include-sound-asound.h-with-4.1-kernel.patch
  0008-conf-ucm-broadwell-rt286-change-to-use-the-correct-j.patch
  0009-namehint-Fix-invalid-list-access-in-snd_device_name_.patch
  0010-namehint-Fix-the-listing-without-device-number.patch
  0011-namehint-Fix-bad-free-with-invalid-iface-name.patch
  0012-Allow-hint-for-ctl-hwdep-timer-and-seq.patch
  0013-conf-Add-hint-descriptions-to-ctl-hwdep-seq-and-time.patch
  0014-conf-ucm-broadwell-rt286-change-to-set-capture-volum.patch
  0015-ucm-allow-multiple-devices-in-JackHWMute.patch
  0016-pcm-Remove-assert-from-snd_pcm_hw_params_slave.patch

OBS-URL: https://build.opensuse.org/request/show/308371
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=181
2015-05-22 12:33:18 +00:00

37 lines
1.1 KiB
Diff

From 67f73b0fab466e780dcc0442e19894a1cbedc43b Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 21 May 2015 07:26:39 +0200
Subject: [PATCH 16/16] pcm: Remove assert() from snd_pcm_hw_params_slave()
Using assert() for non-fatal error checks is really brain-dead.
These are especially bad, as it hits even in the normal operation with
plugins and some h/w constraints.
Reported-by: Alan Horstmann <gineera@aspect135.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_params.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_params.c b/src/pcm/pcm_params.c
index 6e57904e445b..1d667a583151 100644
--- a/src/pcm/pcm_params.c
+++ b/src/pcm/pcm_params.c
@@ -2244,9 +2244,11 @@ int snd_pcm_hw_params_slave(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
snd_pcm_hw_params_t slave_params;
int err;
err = sprepare(pcm, &slave_params);
- assert(err >= 0);
+ if (err < 0)
+ return err;
err = schange(pcm, params, &slave_params);
- assert(err >= 0);
+ if (err < 0)
+ return err;
err = sparams(pcm, &slave_params);
if (err < 0)
cchange(pcm, params, &slave_params);
--
2.4.1