summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2020-06-24 22:51:48 +0900
committerTim-Philipp Müller <tim@centricular.com>2020-09-21 00:34:39 +0100
commit6b8bb822e469f4201dc23c59875f926aad2798af (patch)
tree1efb0d010ac78798cee2d5334f2e937c9d335d98
parentb935ac66425ebde1e1e0fe8261d3b33057a98d33 (diff)
downloadgstreamer-6b8bb822e469f4201dc23c59875f926aad2798af.tar.gz
gst-inspect: Use gst_info_strdup_vprintf to print string
g_vprintf() will write a string binary to stdout directly using fwrite(). So, depending on character in the string, fwrite to stdout can print broken one but printf family might not cause the issue. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/637>
-rw-r--r--tools/gst-inspect.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
index 1d09b08b94..46d7f3bcce 100644
--- a/tools/gst-inspect.c
+++ b/tools/gst-inspect.c
@@ -132,6 +132,7 @@ n_print (const char *format, ...)
{
va_list args;
int i;
+ gchar *str;
if (_name)
g_print ("%s", _name);
@@ -140,8 +141,14 @@ n_print (const char *format, ...)
g_print (" ");
va_start (args, format);
- g_vprintf (format, args);
+ str = gst_info_strdup_vprintf (format, args);
va_end (args);
+
+ if (!str)
+ return;
+
+ g_print ("%s", str);
+ g_free (str);
}
static gboolean