mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 01:32:42 +00:00
aggregator: Ensure that the source pad is created as a GstAggregatorPad if no type is given in the pad template
Otherwise we would create a GstPad and that causes invalid memory accesses later.
This commit is contained in:
parent
b7c1195f29
commit
b8455445c5
1 changed files with 8 additions and 1 deletions
|
@ -2441,6 +2441,7 @@ gst_aggregator_init (GstAggregator * self, GstAggregatorClass * klass)
|
||||||
{
|
{
|
||||||
GstPadTemplate *pad_template;
|
GstPadTemplate *pad_template;
|
||||||
GstAggregatorPrivate *priv;
|
GstAggregatorPrivate *priv;
|
||||||
|
GType pad_type;
|
||||||
|
|
||||||
g_return_if_fail (klass->aggregate != NULL);
|
g_return_if_fail (klass->aggregate != NULL);
|
||||||
|
|
||||||
|
@ -2460,7 +2461,13 @@ gst_aggregator_init (GstAggregator * self, GstAggregatorClass * klass)
|
||||||
self->priv->peer_latency_max = self->priv->sub_latency_max = 0;
|
self->priv->peer_latency_max = self->priv->sub_latency_max = 0;
|
||||||
self->priv->has_peer_latency = FALSE;
|
self->priv->has_peer_latency = FALSE;
|
||||||
|
|
||||||
self->srcpad = gst_pad_new_from_template (pad_template, "src");
|
pad_type =
|
||||||
|
GST_PAD_TEMPLATE_GTYPE (pad_template) ==
|
||||||
|
G_TYPE_NONE ? GST_TYPE_AGGREGATOR_PAD :
|
||||||
|
GST_PAD_TEMPLATE_GTYPE (pad_template);
|
||||||
|
self->srcpad =
|
||||||
|
g_object_new (pad_type, "name", "src", "direction", GST_PAD_SRC,
|
||||||
|
"template", pad_template, NULL);
|
||||||
|
|
||||||
gst_aggregator_reset_flow_values (self);
|
gst_aggregator_reset_flow_values (self);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue