projects
/
platform
/
upstream
/
gst-plugins-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1261c08
)
audio: Fix overread in channel positions
author
Edward Hervey
<edward.hervey@collabora.co.uk>
Wed, 5 Oct 2011 09:51:07 +0000
(11:51 +0200)
committer
Edward Hervey
<edward.hervey@collabora.co.uk>
Wed, 5 Oct 2011 09:51:07 +0000
(11:51 +0200)
The array we're writing to is limited to 64 ... but the amount of
input positions might be lower than 64. Therefore use MIN and not
MAX to know how many values to read from the array.
gst-libs/gst/audio/audio.c
patch
|
blob
|
history
diff --git
a/gst-libs/gst/audio/audio.c
b/gst-libs/gst/audio/audio.c
index
49a4878
..
042364f
100644
(file)
--- a/
gst-libs/gst/audio/audio.c
+++ b/
gst-libs/gst/audio/audio.c
@@
-346,7
+346,8
@@
gst_audio_info_from_caps (GstAudioInfo * info, const GstCaps * caps)
pos_val_arr = gst_structure_get_value (str, "channel-positions");
if (pos_val_arr) {
- guint max_pos = MAX (channels, 64);
+ guint max_pos = MIN (channels, 64);
+
for (i = 0; i < max_pos; i++) {
pos_val_entry = gst_value_array_get_value (pos_val_arr, i);
info->position[i] = g_value_get_enum (pos_val_entry);