mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
bufferlist: make sure list is writable before adding or removing buffers
https://bugzilla.gnome.org/show_bug.cgi?id=747439
This commit is contained in:
parent
c547e01018
commit
a754eb45b9
1 changed files with 2 additions and 0 deletions
|
@ -310,6 +310,7 @@ gst_buffer_list_insert (GstBufferList * list, gint idx, GstBuffer * buffer)
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_BUFFER_LIST (list));
|
g_return_if_fail (GST_IS_BUFFER_LIST (list));
|
||||||
g_return_if_fail (buffer != NULL);
|
g_return_if_fail (buffer != NULL);
|
||||||
|
g_return_if_fail (gst_buffer_list_is_writable (list));
|
||||||
|
|
||||||
if (idx == -1 && list->n_buffers < list->n_allocated) {
|
if (idx == -1 && list->n_buffers < list->n_allocated) {
|
||||||
list->buffers[list->n_buffers++] = buffer;
|
list->buffers[list->n_buffers++] = buffer;
|
||||||
|
@ -359,6 +360,7 @@ gst_buffer_list_remove (GstBufferList * list, guint idx, guint length)
|
||||||
g_return_if_fail (GST_IS_BUFFER_LIST (list));
|
g_return_if_fail (GST_IS_BUFFER_LIST (list));
|
||||||
g_return_if_fail (idx < list->n_buffers);
|
g_return_if_fail (idx < list->n_buffers);
|
||||||
g_return_if_fail (idx + length <= list->n_buffers);
|
g_return_if_fail (idx + length <= list->n_buffers);
|
||||||
|
g_return_if_fail (gst_buffer_list_is_writable (list));
|
||||||
|
|
||||||
gst_buffer_list_remove_range_internal (list, idx, length, TRUE);
|
gst_buffer_list_remove_range_internal (list, idx, length, TRUE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue