From 5a7ed3c89d2cdcd62a6b726629de9e3bf29fdfba Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 2 May 2023 11:34:36 +0200 Subject: [PATCH] srt: assert instead of segfault when passing no error to ERROR_TO_WARNING Part-of: --- subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c b/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c index 6c3ed6f7b7..c857b644ff 100644 --- a/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c +++ b/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c @@ -39,7 +39,9 @@ GST_DEBUG_CATEGORY_EXTERN (gst_debug_srtobject); #define ERROR_TO_WARNING(srtobject, error, suffix) \ G_STMT_START { \ - gchar *text = g_strdup_printf ("%s%s", (error)->message, (suffix)); \ + gchar *text; \ + g_assert (error); \ + text = g_strdup_printf ("%s%s", (error)->message, (suffix)); \ GST_WARNING_OBJECT ((srtobject)->element, "warning: %s", text); \ gst_element_message_full ((srtobject)->element, GST_MESSAGE_WARNING, \ (error)->domain, (error)->code, text, NULL, __FILE__, GST_FUNCTION, \