mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
tests: fix crash and leak in bufferlists unit test
Don't access already-freed iterator, makes check-valgrind work and fixes crash on PPC; unref buffer we're going to steal to make valgrind happy.
This commit is contained in:
parent
c2e980f827
commit
2b4d127ca0
1 changed files with 1 additions and 1 deletions
|
@ -688,6 +688,7 @@ foreach_func4 (GstBuffer ** buffer, guint group, guint idx, ForeachData * data)
|
|||
fail_unless (buffer != NULL);
|
||||
fail_unless (*buffer == data->buf[group][idx]);
|
||||
|
||||
gst_buffer_unref (*buffer);
|
||||
*buffer = NULL;
|
||||
data->iter++;
|
||||
|
||||
|
@ -720,7 +721,6 @@ GST_START_TEST (test_foreach)
|
|||
data.buf[1][1] = gst_buffer_new ();
|
||||
gst_buffer_list_iterator_add (it, data.buf[1][1]);
|
||||
gst_buffer_list_iterator_free (it);
|
||||
gst_buffer_list_iterator_add_group (it);
|
||||
|
||||
fail_unless (gst_buffer_list_get (list, 0, 0) == data.buf[0][0]);
|
||||
fail_unless (gst_buffer_list_get (list, 0, 1) == NULL);
|
||||
|
|
Loading…
Reference in a new issue