From patchwork Wed Nov 11 16:07:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 7596471 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 13B0D9F2F7 for ; Wed, 11 Nov 2015 16:08:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E0E4206D5 for ; Wed, 11 Nov 2015 16:08:42 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DCC31206D8 for ; Wed, 11 Nov 2015 16:08:40 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D7EB1260664; Wed, 11 Nov 2015 17:08:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 86D31260692; Wed, 11 Nov 2015 17:08:29 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A429F2606A5; Wed, 11 Nov 2015 17:08:28 +0100 (CET) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by alsa0.perex.cz (Postfix) with ESMTP id 8B327260563; Wed, 11 Nov 2015 17:08:21 +0100 (CET) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 1420C40011; Wed, 11 Nov 2015 17:08:21 +0100 (CET) Received: from localhost.localdomain (217-210-101-82-no95.business.telia.com [217.210.101.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 7B5DB4000E; Wed, 11 Nov 2015 17:08:20 +0100 (CET) From: Peter Rosin To: patch@alsa-project.org Date: Wed, 11 Nov 2015 17:07:32 +0100 Message-Id: <1447258052-32203-1-git-send-email-peda@lysator.liu.se> X-Mailer: git-send-email 1.7.10.4 X-Virus-Scanned: ClamAV using ClamSMTP Cc: Peter Rosin , alsa-devel@alsa-project.org, Peter Rosin Subject: [alsa-devel] [PATCH] pcm: simple: Fix asserts X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Rosin Do not error out on the boundaries. Signed-off-by: Peter Rosin --- src/pcm/pcm_simple.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pcm/pcm_simple.c b/src/pcm/pcm_simple.c index f943ec0..ce11083 100644 --- a/src/pcm/pcm_simple.c +++ b/src/pcm/pcm_simple.c @@ -173,8 +173,8 @@ int snd_spcm_init(snd_pcm_t *pcm, snd_pcm_sw_params_alloca(&sw_params); assert(pcm); - assert(rate > 5000 && rate < 192000); - assert(channels > 1 && channels < 512); + assert(rate >= 5000 && rate <= 192000); + assert(channels >= 1 && channels <= 512); rrate = rate; err = set_buffer_time(latency, &buffer_time); @@ -233,8 +233,8 @@ int snd_spcm_init_duplex(snd_pcm_t *playback_pcm, assert(playback_pcm); assert(capture_pcm); - assert(rate > 5000 && rate < 192000); - assert(channels > 1 && channels < 512); + assert(rate >= 5000 && rate <= 192000); + assert(channels >= 1 && channels <= 512); pcms[0] = playback_pcm; pcms[1] = capture_pcm;