summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-05-23 16:57:35 +0000
committerLennart Poettering <lennart@poettering.net>2007-05-23 16:57:35 +0000
commit4a05bc9bdcb4404f3e23cef367ff378b9e39d220 (patch)
tree2f5021d5745531f0539d6067ec62c18d030265ca
parentcf925b10e157c0ae87ff876dd8047586226afa87 (diff)
don't allow excessively high sample rates
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1449 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/pulse/sample.c1
-rw-r--r--src/pulse/sample.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/pulse/sample.c b/src/pulse/sample.c
index aafafc83..ffdeedf7 100644
--- a/src/pulse/sample.c
+++ b/src/pulse/sample.c
@@ -80,6 +80,7 @@ int pa_sample_spec_valid(const pa_sample_spec *spec) {
assert(spec);
if (spec->rate <= 0 ||
+ spec->rate > PA_RATE_MAX ||
spec->channels <= 0 ||
spec->channels > PA_CHANNELS_MAX ||
spec->format >= PA_SAMPLE_MAX ||
diff --git a/src/pulse/sample.h b/src/pulse/sample.h
index 5e603685..683167cc 100644
--- a/src/pulse/sample.h
+++ b/src/pulse/sample.h
@@ -105,6 +105,9 @@ PA_C_DECL_BEGIN
/** Maximum number of allowed channels */
#define PA_CHANNELS_MAX 32
+/** Maximum allowed sample rate */
+#define PA_RATE_MAX (48000*4)
+
/** Sample format */
typedef enum pa_sample_format {
PA_SAMPLE_U8, /**< Unsigned 8 Bit PCM */