diff options
author | Zhao, Gang <gang.zhao.42@gmail.com> | 2021-05-09 11:45:49 +0800 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-07-26 11:37:33 +0000 |
commit | 2936448f1a366c8404dd071a7c8ef520e5ab722c (patch) | |
tree | ffe422e9086382c3a7ef92b5e70b30297cbd7f0c /gst | |
parent | ed92fb2430364bd7b9660cf83d32aae00a3ee899 (diff) |
gsturi: Set GError if uri is invalid
GError should be set if function call failed and the failed reason is
not a programmer error.
Fixed: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1380
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/816>
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gsturi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gst/gsturi.c b/gst/gsturi.c index cd736fbcc4..de613658cc 100644 --- a/gst/gsturi.c +++ b/gst/gsturi.c @@ -638,6 +638,8 @@ gst_element_make_from_uri (const GstURIType type, const gchar * uri, g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!gst_uri_is_valid (uri)) { + g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI, + _("Invalid URI: %s"), uri); return NULL; } @@ -809,6 +811,8 @@ gst_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri, g_return_val_if_fail (iface->set_uri != NULL, FALSE); if (!gst_uri_is_valid (uri)) { + g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI, + _("Invalid URI: %s"), uri); return FALSE; } |