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
This commit is contained in:
Jan Alexander Steffens (heftig) 2019-11-12 12:04:48 +01:00
parent f730f4a694
commit 346bca80af
No known key found for this signature in database
GPG key ID: DE5E0C5F25941CA5

View file

@ -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;
}