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/6385>
This commit is contained in:
Philippe Normand 2024-03-17 11:18:37 +00:00
parent 8acf844fed
commit 76d1bd05b2

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