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.
This commit is contained in:
Tim-Philipp Müller 2008-05-22 15:38:54 +00:00
parent 98faaeb7f4
commit 479a58ebfe
4 changed files with 13 additions and 8 deletions

View file

@ -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> 2008-05-22 Sebastian Dröge <slomo@circular-chaos.org>
Patch by: Sjoerd Simons <sjoerd at luon dot net> Patch by: Sjoerd Simons <sjoerd at luon dot net>

View file

@ -26,7 +26,7 @@
* @short_description: Get a pipeline from a text pipeline description * @short_description: Get a pipeline from a text pipeline description
* *
* These function allow to create a pipeline based on the syntax used in the * 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) _gst_parse_escape (const gchar * str)
{ {
GString *gstr = NULL; GString *gstr = NULL;
gchar *newstr = NULL;
g_return_val_if_fail (str != NULL, NULL); g_return_val_if_fail (str != NULL, NULL);
@ -74,10 +73,7 @@ _gst_parse_escape (const gchar * str)
str++; str++;
} }
newstr = gstr->str; return g_string_free (gstr, FALSE);
g_string_free (gstr, FALSE);
return newstr;
} }
#endif /* !GST_DISABLE_PARSE */ #endif /* !GST_DISABLE_PARSE */
@ -102,6 +98,7 @@ gst_parse_launchv (const gchar ** argv, GError ** error)
gchar *tmp; gchar *tmp;
g_return_val_if_fail (argv != NULL, NULL); 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. */ /* let's give it a nice size. */
str = g_string_sized_new (1024); str = g_string_sized_new (1024);
@ -124,7 +121,7 @@ gst_parse_launchv (const gchar ** argv, GError ** error)
#else #else
gchar *msg; 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); 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); g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_DISABLED, "%s", msg);

View file

@ -3377,7 +3377,7 @@ gst_parse_bin_from_description (const gchar * bin_description,
#else #else
gchar *msg; 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); 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); g_set_error (err, GST_CORE_ERROR, GST_CORE_ERROR_DISABLED, "%s", msg);

View file

@ -794,6 +794,7 @@ _gst_parse_launch (const gchar *str, GError **error)
yyscan_t scanner; yyscan_t scanner;
g_return_val_if_fail (str != NULL, NULL); g_return_val_if_fail (str != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
g.chain = NULL; g.chain = NULL;
g.links = NULL; g.links = NULL;