mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
audio: Fix overread in channel positions
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.
This commit is contained in:
parent
1261c08a2f
commit
70d967da7c
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue