summaryrefslogtreecommitdiff
path: root/ext/srtp/gstsrtpenc.c
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2016-09-06 11:02:06 +0200
committerPhilippe Normand <philn@igalia.com>2016-09-06 11:02:06 +0200
commit7fa2668adf377b1909907a22e3f27a479c4ddafa (patch)
treed37b8e97d8098d53bcbcd220bd32468d821fcbe6 /ext/srtp/gstsrtpenc.c
parentf5c547063c77b15e6f7a4d2bb43f735472340bc6 (diff)
downloadgstreamer-plugins-bad-7fa2668adf377b1909907a22e3f27a479c4ddafa.tar.gz
srtpenc: prevent deadlock in create_session
Temporarily release the object lock which is needed to post error messages on the bus. https://bugzilla.gnome.org/show_bug.cgi?id=770933
Diffstat (limited to 'ext/srtp/gstsrtpenc.c')
-rw-r--r--ext/srtp/gstsrtpenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/srtp/gstsrtpenc.c b/ext/srtp/gstsrtpenc.c
index 7f46a4fda..c9ae98070 100644
--- a/ext/srtp/gstsrtpenc.c
+++ b/ext/srtp/gstsrtpenc.c
@@ -386,9 +386,11 @@ gst_srtp_enc_create_session (GstSrtpEnc * filter)
gsize keysize;
if (filter->key == NULL) {
+ GST_OBJECT_UNLOCK (filter);
GST_ELEMENT_ERROR (filter, LIBRARY, SETTINGS,
("Cipher is not NULL, key must be set"),
("Cipher is not NULL, key must be set"));
+ GST_OBJECT_LOCK (filter);
return err_status_fail;
}
@@ -396,10 +398,12 @@ gst_srtp_enc_create_session (GstSrtpEnc * filter)
keysize = gst_buffer_get_size (filter->key);
if (expected != keysize) {
+ GST_OBJECT_UNLOCK (filter);
GST_ELEMENT_ERROR (filter, LIBRARY, SETTINGS,
("Master key size is wrong"),
("Expected master key of %d bytes, but received %" G_GSIZE_FORMAT
" bytes", expected, keysize));
+ GST_OBJECT_LOCK (filter);
return err_status_fail;
}
}