diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/avirt-config.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/avirt-config.c b/src/avirt-config.c index 7a993ad..0f92540 100644 --- a/src/avirt-config.c +++ b/src/avirt-config.c @@ -309,6 +309,12 @@ int snd_avirt_stream_new(const char *name, unsigned int channels, int direction, char path[AVIRT_CONFIGFS_PATH_MAXLEN]; char path_attr[AVIRT_CONFIGFS_PATH_MAXLEN]; + if ((channels > __INT_MAX__) || (channels == 0)) + { + AVIRT_ERROR_V("Channels '%d' is out of range!", channels); + return -ERANGE; + } + IS_CONFIGFS_MOUNTED(); // Check if card is already sealed @@ -362,7 +368,7 @@ int snd_avirt_stream_new(const char *name, unsigned int channels, int direction, AVIRT_DEBUG("No map specified!"); } - AVIRT_DEBUG_V("Created stream: %s", name); + AVIRT_DEBUG_V("Created stream: %s, map: %s, chans: %d", name, map, channels); return 0; } |