diff options
author | Matthew Gregan <[email protected]> | 2011-10-03 11:54:41 +1300 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2011-10-03 11:54:41 +1300 |
commit | 092f5347caa8388e7f1dbb95ab04aca7e3611add (patch) | |
tree | c3f77b5984d7755725b241aa77250b97587265de /src/cubeb_pulse.c | |
parent | 641cd67d306f93ad4eaf48552f5b1a8ed677a020 (diff) | |
download | cubeb-092f5347caa8388e7f1dbb95ab04aca7e3611add.tar.gz cubeb-092f5347caa8388e7f1dbb95ab04aca7e3611add.zip |
Explicitly cap rate, channels, and latency.
Diffstat (limited to 'src/cubeb_pulse.c')
-rw-r--r-- | src/cubeb_pulse.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c index 571e08b..44f3e18 100644 --- a/src/cubeb_pulse.c +++ b/src/cubeb_pulse.c @@ -247,6 +247,12 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n pa_buffer_attr battr; pa_channel_map map; + if (stream_params.rate < 1 || stream_params.rate > 192000 || + stream_params.channels < 1 || stream_params.channels > 32 || + latency < 1 || latency > 2000) { + return CUBEB_ERROR_INVALID_FORMAT; + } + switch (stream_params.format) { case CUBEB_SAMPLE_S16LE: ss.format = PA_SAMPLE_S16LE; |