projects
/
profile
/
ivi
/
pulseaudio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f7cc0c
)
don't allow channel positions to be specified twice in the same channelmap
author
Lennart Poettering
<lennart@poettering.net>
Wed, 26 Apr 2006 15:37:13 +0000
(15:37 +0000)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 26 Apr 2006 15:37:13 +0000
(15:37 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@801
fefdeb5f
-60dc-0310-8127-
8f9354f1896f
src/polyp/channelmap.c
patch
|
blob
|
history
diff --git
a/src/polyp/channelmap.c
b/src/polyp/channelmap.c
index
8d642a0
..
38349bf
100644
(file)
--- a/
src/polyp/channelmap.c
+++ b/
src/polyp/channelmap.c
@@
-277,10
+277,19
@@
int pa_channel_map_valid(const pa_channel_map *map) {
if (map->channels <= 0 || map->channels > PA_CHANNELS_MAX)
return 0;
- for (c = 0; c < map->channels; c++)
+ for (c = 0; c < map->channels; c++) {
+ unsigned k;
+
if (map->map[c] < 0 ||map->map[c] >= PA_CHANNEL_POSITION_MAX)
return 0;
+ /* Don't allow positions to be specified twice */
+ for (k = 0; k < c; k++)
+ if (map->map[k] == map->map[c])
+ return 0;
+
+ }
+
return 1;
}