Commit cd3a49b6 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

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.
parent 733de319
......@@ -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.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment