summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2017-04-07 10:19:43 +0100
committerSebastian Dröge <sebastian@centricular.com>2017-04-09 11:17:19 +0300
commitcd78fc58ec8bde75d2e68125ed9e10a89482f81e (patch)
treeb34eb0d498246ce2582ebeba278e356d720c7e95
parent8a5d6397c184687fd56ee393a9ec46d9603d82e0 (diff)
downloadgstreamer-plugins-bad-cd78fc58ec8bde75d2e68125ed9e10a89482f81e.tar.gz
gstaggregator: fix event use after free
https://bugzilla.gnome.org/show_bug.cgi?id=781017
-rw-r--r--gst-libs/gst/base/gstaggregator.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gst-libs/gst/base/gstaggregator.c b/gst-libs/gst/base/gstaggregator.c
index 7e8c5be44..d693541ea 100644
--- a/gst-libs/gst/base/gstaggregator.c
+++ b/gst-libs/gst/base/gstaggregator.c
@@ -2351,17 +2351,12 @@ gst_aggregator_pad_event_func (GstPad * pad, GstObject * parent,
}
if (event) {
+ gboolean is_caps = (GST_EVENT_TYPE (event) == GST_EVENT_CAPS);
+
if (!klass->sink_event (self, aggpad, event)) {
/* Copied from GstPad to convert boolean to a GstFlowReturn in
* the event handling func */
- switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_CAPS:
- ret = GST_FLOW_NOT_NEGOTIATED;
- break;
- default:
- ret = GST_FLOW_ERROR;
- break;
- }
+ ret = is_caps ? GST_FLOW_NOT_NEGOTIATED : GST_FLOW_ERROR;
}
}