Skip to content

rtpjitterbuffer: Properly free internal packets queue in finalize()

As we override the GLib item with our own structure, we cannot use any function from GList or GQueue that would try to free the RTPJitterBufferItem. In this patch, we move away from g_queue_new() which forces using g_queue_free(). This this function could use g_slice_free() if there is any items left in the queue. Passing the wrong size to GSLice may cause data corruption and crash.

A better approach would be to use a proper intrusive linked list implementation but that's left as an exercise for the next person running into crashes caused by this.

Be ware that this regression was introduced 6 years ago in the following commit [0], the call to flush() looked useless, as there was a g_queue_free() afterward.

Signed-off-by: Nicolas Dufresne nicolas.dufresne@collabora.com

[0] 479c7642


See also gst-plugins-rs!315 (merged)

CC @ndufresne @hgr

Edited by Tim-Philipp Müller

Merge request reports

Loading