loopback: Validate the rate parameter

This commit is contained in:
Georg Chini 2015-02-25 19:43:24 +01:00 committed by Tanu Kaskinen
parent 12b5e7c873
commit fc803b4883

View file

@ -799,6 +799,11 @@ int pa__init(pa_module *m) {
goto fail; goto fail;
} }
if (ss.rate < 4000 || ss.rate > PA_RATE_MAX) {
pa_log("Invalid rate specification, valid range is 4000 Hz to %i Hz", PA_RATE_MAX);
goto fail;
}
if (pa_modargs_get_value(ma, "format", NULL)) if (pa_modargs_get_value(ma, "format", NULL))
format_set = true; format_set = true;