gst/: More guards against bad input; typo fix; some minor clean-ups.
authorTim-Philipp Müller <tim@centricular.net>
Thu, 22 May 2008 15:38:54 +0000 (15:38 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 22 May 2008 15:38:54 +0000 (15:38 +0000)
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
gst/gstparse.c
gst/gstutils.c
gst/parse/grammar.y

index 1f6992e..3c23338 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-22  Tim-Philipp Müller  <tim.muller at collabora co uk>
+
+       * 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  <slomo@circular-chaos.org>
 
        Patch by: Sjoerd Simons <sjoerd at luon dot net>
index ba6a6f1..5dd06cc 100644 (file)
@@ -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);
index a88402c..d000f90 100644 (file)
@@ -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);
index b99cde8..db02abd 100644 (file)
@@ -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;