Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dylan Van Assche
pulseaudio
Commits
9333e89f
Commit
9333e89f
authored
Aug 29, 2009
by
Lennart Poettering
Committed by
Colin Guthrie
Sep 01, 2009
Browse files
native: make sure clients cannot trigger an assert by sending us invalid volume info
parent
b10bddf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pulsecore/protocol-native.c
View file @
9333e89f
...
...
@@ -3322,12 +3322,19 @@ static void command_set_volume(
CHECK_VALIDITY
(
c
->
pstream
,
si
||
sink
||
source
,
tag
,
PA_ERR_NOENTITY
);
if
(
sink
)
if
(
sink
)
{
CHECK_VALIDITY
(
c
->
pstream
,
pa_cvolume_compatible
(
&
volume
,
&
sink
->
sample_spec
),
tag
,
PA_ERR_INVALID
);
pa_sink_set_volume
(
sink
,
&
volume
,
TRUE
,
TRUE
,
TRUE
);
else
if
(
source
)
}
else
if
(
source
)
{
CHECK_VALIDITY
(
c
->
pstream
,
pa_cvolume_compatible
(
&
volume
,
&
source
->
sample_spec
),
tag
,
PA_ERR_INVALID
);
pa_source_set_volume
(
source
,
&
volume
);
else
if
(
si
)
}
else
if
(
si
)
{
CHECK_VALIDITY
(
c
->
pstream
,
pa_cvolume_compatible
(
&
volume
,
&
si
->
sample_spec
),
tag
,
PA_ERR_INVALID
);
pa_sink_input_set_volume
(
si
,
&
volume
,
TRUE
,
TRUE
);
}
pa_pstream_send_simple_ack
(
c
->
pstream
,
tag
);
}
...
...
@@ -3368,7 +3375,6 @@ static void command_set_mute(
switch
(
command
)
{
case
PA_COMMAND_SET_SINK_MUTE
:
if
(
idx
!=
PA_INVALID_INDEX
)
sink
=
pa_idxset_get_by_index
(
c
->
protocol
->
core
->
sinks
,
idx
);
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment