From patchwork Wed Nov 11 15:11:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 7596211 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 960DA9F2F7 for ; Wed, 11 Nov 2015 15:12:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B645F20656 for ; Wed, 11 Nov 2015 15:12:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EC7C1204A2 for ; Wed, 11 Nov 2015 15:12:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 383F42606FD; Wed, 11 Nov 2015 16:12:17 +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 EADB12604E4; Wed, 11 Nov 2015 16:12:08 +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 7BD6F2604E4; Wed, 11 Nov 2015 16:12:08 +0100 (CET) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by alsa0.perex.cz (Postfix) with ESMTP id 0DE312604A9; Wed, 11 Nov 2015 16:12:00 +0100 (CET) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 3457340044; Wed, 11 Nov 2015 16:12:00 +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 06B1640045; Wed, 11 Nov 2015 16:11:58 +0100 (CET) From: Peter Rosin To: patch@alsa-project.org Date: Wed, 11 Nov 2015 16:11:10 +0100 Message-Id: <1447254670-31813-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;