@@ -209,6 +209,11 @@ gst_inter_pipe_sink_init (GstInterPipeSink * sink)
209209
210210 g_mutex_init (& sink -> listeners_mutex );
211211
212+ /* Set the struct buffer to 0's so if in the future more callbacks are added
213+ * does not cause a segmentation fault down the line
214+ */
215+ memset (& callbacks , 0 , sizeof (callbacks ));
216+
212217 /* AppSink callbacks */
213218 callbacks .eos = GST_DEBUG_FUNCPTR (gst_inter_pipe_sink_eos );
214219 callbacks .new_sample = GST_DEBUG_FUNCPTR (gst_inter_pipe_sink_new_buffer );
@@ -220,7 +225,7 @@ gst_inter_pipe_sink_init (GstInterPipeSink * sink)
220225 gst_base_sink_set_sync (GST_BASE_SINK (sink ), FALSE);
221226 gst_app_sink_set_max_buffers (GST_APP_SINK (sink ), 3 );
222227
223- /* When a change in the interpipesink name happens, the callback function
228+ /* When a change in the interpipesink name happens, the callback function
224229 will update the node name and the nodes list */
225230 g_object_notify (G_OBJECT (sink ), "name" );
226231
@@ -747,9 +752,9 @@ gst_inter_pipe_sink_add_listener (GstInterPipeINode * iface,
747752 has_listeners = 0 != g_hash_table_size (listeners );
748753
749754 if (!sink -> caps_negotiated && !has_listeners
750- && !gst_caps_is_equal (srccaps , sinkcaps )) {
755+ && !gst_caps_is_equal (srccaps , sinkcaps )) {
751756
752- if (!gst_pad_push_event (GST_INTER_PIPE_SINK_PAD (sink ),
757+ if (!gst_pad_push_event (GST_INTER_PIPE_SINK_PAD (sink ),
753758 gst_event_new_reconfigure ()))
754759 goto reconfigure_event_error ;
755760
0 commit comments