mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
discoverer: don't crash on unknown info types when deserializing
Handle unknown info types when deserializing instead of dereferencing NULL pointers. Coverity CID 1302394
This commit is contained in:
parent
6ab46d8f0a
commit
a24b9cd5c2
1 changed files with 9 additions and 4 deletions
|
@ -1875,7 +1875,8 @@ _parse_discovery (GVariant * variant, GstDiscovererInfo * info)
|
||||||
g_variant_get_child_value (specific, 0));
|
g_variant_get_child_value (specific, 0));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
GST_WARNING ("Unexpected discoverer info type %d", type);
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
_parse_common_stream_info (sinfo, g_variant_get_child_value (common, 0));
|
_parse_common_stream_info (sinfo, g_variant_get_child_value (common, 0));
|
||||||
|
@ -1895,13 +1896,17 @@ _parse_discovery (GVariant * variant, GstDiscovererInfo * info)
|
||||||
while ((child = g_variant_iter_next_value (&iter))) {
|
while ((child = g_variant_iter_next_value (&iter))) {
|
||||||
GstDiscovererStreamInfo *child_info;
|
GstDiscovererStreamInfo *child_info;
|
||||||
child_info = _parse_discovery (g_variant_get_variant (child), info);
|
child_info = _parse_discovery (g_variant_get_variant (child), info);
|
||||||
cinfo->streams =
|
if (child_info != NULL) {
|
||||||
g_list_append (cinfo->streams,
|
cinfo->streams =
|
||||||
gst_discoverer_stream_info_ref (child_info));
|
g_list_append (cinfo->streams,
|
||||||
|
gst_discoverer_stream_info_ref (child_info));
|
||||||
|
}
|
||||||
g_variant_unref (child);
|
g_variant_unref (child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
|
||||||
g_variant_unref (common);
|
g_variant_unref (common);
|
||||||
g_variant_unref (specific);
|
g_variant_unref (specific);
|
||||||
g_variant_unref (variant);
|
g_variant_unref (variant);
|
||||||
|
|
Loading…
Reference in a new issue