From 479a58ebfefcc907e10833f1fad082e94d213f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 22 May 2008 15:38:54 +0000 Subject: [PATCH] gst/: More guards against bad input; typo fix; some minor clean-ups. Original commit message from CVS: * gst/gstparse.c: (_gst_parse_escape), (gst_parse_launchv): * gst/gstutils.c: (gst_parse_bin_from_description): * gst/parse/grammar.y: (graph): More guards against bad input; typo fix; some minor clean-ups. --- ChangeLog | 7 +++++++ gst/gstparse.c | 11 ++++------- gst/gstutils.c | 2 +- gst/parse/grammar.y | 1 + 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f6992e533..3c23338c61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-22 Tim-Philipp Müller + + * gst/gstparse.c: (_gst_parse_escape), (gst_parse_launchv): + * gst/gstutils.c: (gst_parse_bin_from_description): + * gst/parse/grammar.y: (graph): + More guards against bad input; typo fix; some minor clean-ups. + 2008-05-22 Sebastian Dröge Patch by: Sjoerd Simons diff --git a/gst/gstparse.c b/gst/gstparse.c index ba6a6f1fbe..5dd06cc5d3 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -26,7 +26,7 @@ * @short_description: Get a pipeline from a text pipeline description * * These function allow to create a pipeline based on the syntax used in the - * gst-launch utillity. + * gst-launch utility. */ @@ -61,7 +61,6 @@ static gchar * _gst_parse_escape (const gchar * str) { GString *gstr = NULL; - gchar *newstr = NULL; g_return_val_if_fail (str != NULL, NULL); @@ -74,10 +73,7 @@ _gst_parse_escape (const gchar * str) str++; } - newstr = gstr->str; - g_string_free (gstr, FALSE); - - return newstr; + return g_string_free (gstr, FALSE); } #endif /* !GST_DISABLE_PARSE */ @@ -102,6 +98,7 @@ gst_parse_launchv (const gchar ** argv, GError ** error) gchar *tmp; g_return_val_if_fail (argv != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); /* let's give it a nice size. */ str = g_string_sized_new (1024); @@ -124,7 +121,7 @@ gst_parse_launchv (const gchar ** argv, GError ** error) #else gchar *msg; - GST_WARNING ("Disabled API called: gst_parse_launchv()"); + GST_WARNING ("Disabled API called"); msg = gst_error_get_message (GST_CORE_ERROR, GST_CORE_ERROR_DISABLED); g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_DISABLED, "%s", msg); diff --git a/gst/gstutils.c b/gst/gstutils.c index a88402ca21..d000f9096b 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -3377,7 +3377,7 @@ gst_parse_bin_from_description (const gchar * bin_description, #else gchar *msg; - GST_WARNING ("Disabled API called: gst_parse_bin_from_description()"); + GST_WARNING ("Disabled API called"); msg = gst_error_get_message (GST_CORE_ERROR, GST_CORE_ERROR_DISABLED); g_set_error (err, GST_CORE_ERROR, GST_CORE_ERROR_DISABLED, "%s", msg); diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index b99cde8107..db02abd73a 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -794,6 +794,7 @@ _gst_parse_launch (const gchar *str, GError **error) yyscan_t scanner; g_return_val_if_fail (str != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); g.chain = NULL; g.links = NULL;