diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2017-04-07 10:19:43 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-05-08 18:04:56 +0200 |
commit | 17215f65c916f6f7ff6430734c47c4936da3d3d0 (patch) | |
tree | 52d717179c767ea74d977e01287fe41a31b3f144 | |
parent | 424ddb34d73fedff9131c0ccf70e933d7411b51a (diff) | |
download | gstreamer-plugins-bad-17215f65c916f6f7ff6430734c47c4936da3d3d0.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.c | 11 |
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; } } |