mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
srtp: zero out session member on dealloc
Fixes a user-after-free retrieving stats from _get_property()
This commit is contained in:
parent
63dd27a785
commit
029e01743f
2 changed files with 6 additions and 2 deletions
|
@ -777,8 +777,10 @@ gst_srtp_dec_clear_streams (GstSrtpDec * filter)
|
|||
|
||||
GST_OBJECT_LOCK (filter);
|
||||
|
||||
if (!filter->first_session)
|
||||
if (!filter->first_session) {
|
||||
srtp_dealloc (filter->session);
|
||||
filter->session = NULL;
|
||||
}
|
||||
|
||||
if (filter->streams)
|
||||
nb = g_hash_table_foreach_remove (filter->streams, remove_yes, NULL);
|
||||
|
|
|
@ -447,8 +447,10 @@ gst_srtp_enc_create_session (GstSrtpEnc * filter)
|
|||
static void
|
||||
gst_srtp_enc_reset_no_lock (GstSrtpEnc * filter)
|
||||
{
|
||||
if (!filter->first_session)
|
||||
if (!filter->first_session) {
|
||||
srtp_dealloc (filter->session);
|
||||
filter->session = NULL;
|
||||
}
|
||||
|
||||
filter->first_session = TRUE;
|
||||
filter->key_changed = FALSE;
|
||||
|
|
Loading…
Reference in a new issue