mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
discoverer: Only allow serializing OK discoverer infos to GVariants
They will be incomplete otherwise and we can't generate the full serialized information, and instead will crash somewhere on the way. https://bugzilla.gnome.org/show_bug.cgi?id=767859
This commit is contained in:
parent
2ac5bd293b
commit
26f63db498
2 changed files with 6 additions and 1 deletions
|
@ -2200,11 +2200,14 @@ gst_discoverer_info_to_variant (GstDiscovererInfo * info,
|
||||||
/* FIXME: implement TOC support */
|
/* FIXME: implement TOC support */
|
||||||
GVariant *stream_variant;
|
GVariant *stream_variant;
|
||||||
GVariant *variant;
|
GVariant *variant;
|
||||||
GstDiscovererStreamInfo *sinfo = gst_discoverer_info_get_stream_info (info);
|
GstDiscovererStreamInfo *sinfo;
|
||||||
GVariant *wrapper;
|
GVariant *wrapper;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_DISCOVERER_INFO (info), NULL);
|
g_return_val_if_fail (GST_IS_DISCOVERER_INFO (info), NULL);
|
||||||
|
g_return_val_if_fail (gst_discoverer_info_get_result (info) ==
|
||||||
|
GST_DISCOVERER_OK, NULL);
|
||||||
|
|
||||||
|
sinfo = gst_discoverer_info_get_stream_info (info);
|
||||||
stream_variant = gst_discoverer_info_to_variant_recurse (sinfo, flags);
|
stream_variant = gst_discoverer_info_to_variant_recurse (sinfo, flags);
|
||||||
variant =
|
variant =
|
||||||
g_variant_new ("(vv)", _serialize_info (info, flags), stream_variant);
|
g_variant_new ("(vv)", _serialize_info (info, flags), stream_variant);
|
||||||
|
|
|
@ -66,6 +66,8 @@ GST_START_TEST (test_disco_serializing)
|
||||||
|
|
||||||
info = gst_discoverer_discover_uri (dc, uri, &err);
|
info = gst_discoverer_discover_uri (dc, uri, &err);
|
||||||
fail_unless (info);
|
fail_unless (info);
|
||||||
|
fail_unless_equals_int (gst_discoverer_info_get_result (info),
|
||||||
|
GST_DISCOVERER_OK);
|
||||||
serialized =
|
serialized =
|
||||||
gst_discoverer_info_to_variant (info, GST_DISCOVERER_SERIALIZE_ALL);
|
gst_discoverer_info_to_variant (info, GST_DISCOVERER_SERIALIZE_ALL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue