mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
bufferlist: avoid reading past the array
When the foreach function told us to remove the buffer from the list, decrease the length of the array or else we might read past the last item in the array.
This commit is contained in:
parent
e694f5e71c
commit
03cdd32b33
1 changed files with 1 additions and 0 deletions
|
@ -210,6 +210,7 @@ gst_buffer_list_foreach (GstBufferList * list, GstBufferListFunc func,
|
|||
if (buf != buf_ret) {
|
||||
if (buf_ret == NULL) {
|
||||
g_array_remove_index (list->array, i);
|
||||
len--;
|
||||
} else {
|
||||
g_array_index (list->array, GstBuffer *, i) = buf_ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue