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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6387>
This commit is contained in:
Philippe Normand 2024-03-17 11:18:37 +00:00 committed by Tim-Philipp Müller
parent 93255efece
commit 559278420b

View file

@ -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);