SrtpDec: request-key-callback results in app crash

Matthew Waters ystreet00 at gmail.com
Tue Nov 24 00:22:08 UTC 2020


Hi,

You have a number of memory errors in your callback as outlined below.  
You should probably use something like valgrind to have a look at where 
there may be other memory errors.

On 23/11/20 12:37 pm, Jochen Jung wrote:
> Hello,
>
>
> I have a similar problem to Need Help Regarding SRTPDEC 
> request_key_callback 
> <https://lists.freedesktop.org/archives/gstreamer-devel/2020-April/074627.html>, 
> which was eventually not resolved.
>
> The following callback is used:
>
>     GstCapsStreamDecrypt::keyRequested([[maybe_unused]]GstElementelement,guintssrc,gpointerdata)
>

This is wrong and needs to have the argument 'GstElement * element'

>     {
>
>     GstCaps*caps=(GstCaps*)data;
>
>     GValueval_ssrc=G_VALUE_INIT;
>
>     g_value_init(&val_ssrc,G_TYPE_UINT);
>
>     g_value_set_uint(&val_ssrc,ssrc);
>
>     gst_caps_set_value(caps,"ssrc",&val_ssrc);
>
>     dump(caps);// print GstCaps
>
>     return*caps;
>

This is wrong, you should not be dereferencing the pointer.

>     }
>
>
> This is how the request-key signal is connected:
>
>     g_signal_connect(decrypt->getGstElement(),"request-key",G_CALLBACK(StreamDecrypt::keyRequested),decrypt->getCapsSrtp());
>
>     // decrypt->getGstElement() returns the GstElement* of the GstSrtpDec.
>
>     // decrypt->getCapsSrtp() returns the GstCaps*.
>
>
> I confirmed that the GstCaps are set correctly, which are:
>
>     application/x-srtp,
>     srtp-key=(buffer)c99a66320db73158a35a255d051758e95ed4abb2cdc69bb454110e827441,
>     srtp-cipher=(string)aes-128-icm, srtp-auth=(string)hmac-sha1-80,
>     srtcp-cipher=(string)aes-128-icm, srtcp-auth=(string)hmac-sha1-80,
>     media=(string)audio, clock-rate=(int)8000,
>     encoding-name=(string)PCMU, payload=(int)0, ssrc=(uint)112235;
>
>
> During runtime i get the following error:
>
>     (AudioStream:9995): GLib-GObject-CRITICAL **: 02:12:00.065:
>     g_object_unref: assertion 'G_IS_OBJECT (object)' failed
>
>     ** (AudioStream:9995): CRITICAL **: 02:12:00.065:
>     update_session_stream_from_caps: assertion 'GST_IS_SRTP_DEC
>     (filter)' failed
>
>
> I traced this error back to a function in GstPad. The function 
> ACQUIRE_PARENT(pad, parent, label) returns an invliad GstSrtpDev 
> object. This invalid GstSrtpDecresults in the above mentioned errors 
> in GstSrtpDec::update_session_stream_from_caps. The app crash occurs 
> in GstCaps::gst_caps_to_string.
>
> Can anyone please tell me what i am doing wrong here? If everything is 
> set up correctly i have to assume this is a bug in the plugin.
>
>
> Thanks in advance and regards,
> Jochen Jung
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201124/70c2e161/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201124/70c2e161/attachment-0001.sig>


More information about the gstreamer-devel mailing list