aboutsummaryrefslogtreecommitdiffstats
path: root/pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcm.c')
-rw-r--r--pcm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pcm.c b/pcm.c
index ff1b5fc..a62d89a 100644
--- a/pcm.c
+++ b/pcm.c
@@ -84,6 +84,10 @@ static int pcm_open(struct snd_pcm_substream *substream)
// Setup remaining hw properties
chans = stream->channels;
+ if (chans == 0) {
+ D_ERRORK("Channels cannot be 0");
+ return -EINVAL;
+ }
hw->channels_min = chans;
hw->channels_max = chans;