From 559278420bb8c4a0208b2a26d8a7b347057efab8 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sun, 17 Mar 2024 11:18:37 +0000 Subject: [PATCH] play: Fix a critical warning in error callback `on_error()` can be called with a NULL details structure, so in that situation the `gst_structure_copy()` would raise a critical warning. Create an empty structure instead of attempting to copy a NULL one. Part-of: --- subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c b/subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c index a88e4c302e..ba0b1e80b3 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c @@ -981,7 +981,11 @@ on_error (GstPlay * self, GError * err, const GstStructure * details) g_quark_to_string (err->domain), err->code); #ifndef GST_DISABLE_GST_DEBUG - extra_details = gst_structure_copy (details); + if (details != NULL) { + extra_details = gst_structure_copy (details); + } else { + extra_details = gst_structure_new_empty ("error-details"); + } if (gst_play_config_get_pipeline_dump_in_error_details (self->config)) { dot_data = gst_debug_bin_to_dot_data (GST_BIN_CAST (self->playbin), GST_DEBUG_GRAPH_SHOW_ALL);