mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
amc: Add an assertion for NULL GErrors
Should never happen! But an assertion is better than a NULL pointer dereference.
This commit is contained in:
parent
31e1b7ceeb
commit
8c57341241
1 changed files with 8 additions and 4 deletions
|
@ -167,8 +167,10 @@ gboolean gst_amc_audio_channel_mask_to_positions (guint32 channel_mask, gint cha
|
|||
guint32 gst_amc_audio_channel_mask_from_positions (GstAudioChannelPosition *positions, gint channels);
|
||||
void gst_amc_codec_info_to_caps (const GstAmcCodecInfo * codec_info, GstCaps **sink_caps, GstCaps **src_caps);
|
||||
|
||||
#define GST_ELEMENT_ERROR_FROM_ERROR(el, err) G_STMT_START { \
|
||||
gchar *__dbg = g_strdup (err->message); \
|
||||
#define GST_ELEMENT_ERROR_FROM_ERROR(el, err) G_STMT_START { \
|
||||
gchar *__dbg; \
|
||||
g_assert (err != NULL); \
|
||||
__dbg = g_strdup (err->message); \
|
||||
GST_WARNING_OBJECT (el, "error: %s", __dbg); \
|
||||
gst_element_message_full (GST_ELEMENT(el), GST_MESSAGE_ERROR, \
|
||||
err->domain, err->code, \
|
||||
|
@ -176,8 +178,10 @@ void gst_amc_codec_info_to_caps (const GstAmcCodecInfo * codec_info, GstCaps **s
|
|||
g_clear_error (&err); \
|
||||
} G_STMT_END
|
||||
|
||||
#define GST_ELEMENT_WARNING_FROM_ERROR(el, err) G_STMT_START { \
|
||||
gchar *__dbg = g_strdup (err->message); \
|
||||
#define GST_ELEMENT_WARNING_FROM_ERROR(el, err) G_STMT_START { \
|
||||
gchar *__dbg; \
|
||||
g_assert (err != NULL); \
|
||||
__dbg = g_strdup (err->message); \
|
||||
GST_WARNING_OBJECT (el, "error: %s", __dbg); \
|
||||
gst_element_message_full (GST_ELEMENT(el), GST_MESSAGE_WARNING, \
|
||||
err->domain, err->code, \
|
||||
|
|
Loading…
Reference in a new issue