From 877f2b68006e787dff2335282220764e400b4ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 2 Dec 2020 09:22:35 +0200 Subject: [PATCH] streams: gst_stream_type_get_name() is not nullable It takes an enum and only the defined values are valid to pass in here as it's not extensible from the outside. Add a g_return_val_if_reached() for the unreachable case and return "invalid". Part-of: --- gst/gststreams.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gst/gststreams.c b/gst/gststreams.c index 77c62998e8..6df80d1aa1 100644 --- a/gst/gststreams.c +++ b/gst/gststreams.c @@ -543,7 +543,7 @@ gst_stream_get_property (GObject * object, guint prop_id, * * Get a descriptive string for a given #GstStreamType * - * Returns: (nullable): A string describing the stream type + * Returns: A string describing the stream type * * Since: 1.10 */ @@ -563,8 +563,7 @@ gst_stream_type_get_name (GstStreamType stype) case GST_STREAM_TYPE_TEXT: return "text"; default: - return NULL; + g_return_val_if_reached ("invalid"); + return "invalid"; } - - return NULL; }