From: Michael Olbrich Date: Thu, 19 Jul 2018 15:21:22 +0000 (+0200) Subject: srtpdec: fix "srtp-key" check X-Git-Tag: 1.22.7~350 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb2dcf40b9be38b6d966b597cf11af029ff875f6;p=platform%2Fupstream%2Fgstreamer.git srtpdec: fix "srtp-key" check The original code was: if (!gst_structure_get (s, "srtp-key", GST_TYPE_BUFFER, &buf, NULL) || !buf) { goto error; } else { stream->key = buf; } So use "srtp-key" if it is set so a non NULL buffer. The condition was incorrectly inverted in ad7ffe64a66ab48d81671651031c449149db4973 to: if (gst_structure_get (s, "srtp-key", GST_TYPE_BUFFER, &buf, NULL) || !buf) { stream->key = buf; } ... Fix the condition so it works as originally intended and avoid accessing 'buf' uninitialised. Part-of: --- diff --git a/subprojects/gst-plugins-bad/ext/srtp/gstsrtpdec.c b/subprojects/gst-plugins-bad/ext/srtp/gstsrtpdec.c index 2467f1b..591bfeb 100644 --- a/subprojects/gst-plugins-bad/ext/srtp/gstsrtpdec.c +++ b/subprojects/gst-plugins-bad/ext/srtp/gstsrtpdec.c @@ -606,7 +606,7 @@ get_stream_from_caps (GstSrtpDec * filter, GstCaps * caps, guint32 ssrc) goto error; } - if (gst_structure_get (s, "srtp-key", GST_TYPE_BUFFER, &buf, NULL) || !buf) { + if (gst_structure_get (s, "srtp-key", GST_TYPE_BUFFER, &buf, NULL) && buf) { #ifdef HAVE_SRTP2 GstBuffer *mki = NULL; guint i;