From 346bca80af4c00e126dc51eb20653cb3697f51fd Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Tue, 12 Nov 2019 12:04:48 +0100 Subject: [PATCH] rtmp2: Fix NULL check in gst_rtmp_meta_transform Coverity rightly complains that checking a pointer for NULL after dereferencing it is pointless. Remove the check, and to be safe, assert that gst_buffer_add_meta returns non-NULL. CID 1455485 --- gst/rtmp2/rtmp/rtmpmessage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/rtmp2/rtmp/rtmpmessage.c b/gst/rtmp2/rtmp/rtmpmessage.c index 1fba1d47b4..cf93eb34d6 100644 --- a/gst/rtmp2/rtmp/rtmpmessage.c +++ b/gst/rtmp2/rtmp/rtmpmessage.c @@ -196,7 +196,7 @@ gst_rtmp_meta_transform (GstBuffer * dest, GstMeta * meta, GstBuffer * buffer, dmeta->type = smeta->type; dmeta->mstream = smeta->mstream; - return dmeta != NULL; + return TRUE; } const GstMetaInfo * @@ -221,6 +221,7 @@ gst_buffer_add_rtmp_meta (GstBuffer * buffer) g_return_val_if_fail (GST_IS_BUFFER (buffer), NULL); meta = (GstRtmpMeta *) gst_buffer_add_meta (buffer, GST_RTMP_META_INFO, NULL); + g_assert (meta != NULL); return meta; }