diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-05-02 14:35:50 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-05-02 14:35:50 +0300 |
commit | cd3a49b69bc013d1722b5a57e37ee03f9afc1a6b (patch) | |
tree | 01d1b1139c92533708a5b2c152dea44aa0e2992a | |
parent | 733de3190b98f9fb7c9b7240ad2d2abb104a8c8a (diff) |
message: Don't pass a NULL debug string to g_utf8_validate()
g_utf8_validate() crashes on NULL, but NULL is valid for the debug
string nonetheless.
-rw-r--r-- | gst/gstmessage.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/gstmessage.c b/gst/gstmessage.c index e426d3c45..5f36662e5 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -416,7 +416,7 @@ gst_message_new_error_with_details (GstObject * src, GError * error, GstMessage *message; GstStructure *structure; - if (!g_utf8_validate (debug, -1, NULL)) { + if (debug && !g_utf8_validate (debug, -1, NULL)) { debug = NULL; g_warning ("Trying to set debug field of error message, but " "string is not valid UTF-8. Please file a bug."); @@ -508,7 +508,7 @@ gst_message_new_warning_with_details (GstObject * src, GError * error, GstMessage *message; GstStructure *structure; - if (!g_utf8_validate (debug, -1, NULL)) { + if (debug && !g_utf8_validate (debug, -1, NULL)) { debug = NULL; g_warning ("Trying to set debug field of warning message, but " "string is not valid UTF-8. Please file a bug."); @@ -598,7 +598,7 @@ gst_message_new_info_with_details (GstObject * src, GError * error, GstMessage *message; GstStructure *structure; - if (!g_utf8_validate (debug, -1, NULL)) { + if (debug && !g_utf8_validate (debug, -1, NULL)) { debug = NULL; g_warning ("Trying to set debug field of info message, but " "string is not valid UTF-8. Please file a bug."); |