gstaggregator: fix event use after free

https://bugzilla.gnome.org/show_bug.cgi?id=781017
This commit is contained in:
Vincent Penquerc'h 2017-04-07 10:19:43 +01:00 committed by Tim-Philipp Müller
parent 5fefb1b866
commit d5f42683ef

View file

@ -2351,17 +2351,12 @@ gst_aggregator_pad_event_func (GstPad * pad, GstObject * parent,
} }
if (event) { if (event) {
gboolean is_caps = (GST_EVENT_TYPE (event) == GST_EVENT_CAPS);
if (!klass->sink_event (self, aggpad, event)) { if (!klass->sink_event (self, aggpad, event)) {
/* Copied from GstPad to convert boolean to a GstFlowReturn in /* Copied from GstPad to convert boolean to a GstFlowReturn in
* the event handling func */ * the event handling func */
switch (GST_EVENT_TYPE (event)) { ret = is_caps ? GST_FLOW_NOT_NEGOTIATED : GST_FLOW_ERROR;
case GST_EVENT_CAPS:
ret = GST_FLOW_NOT_NEGOTIATED;
break;
default:
ret = GST_FLOW_ERROR;
break;
}
} }
} }