GNOME Bugzilla – Bug 773093
basetransform: Fix race when toggling passthrough
Last modified: 2018-11-03 12:37:20 UTC
This fixes a race where priv->passthrough is changed from TRUE to FALSE while processing a buffer and we end up passing a non-writable buffer to transform_ip(). More precicely if passthrough is changed just after prepare_output_buffer() is finished. Since priv->passthrough and other priv variables are accessed throughout the chain function a lock is introduced and held while processing the buffer, but released before pushing downstream. Since sub-classes may call is_passthrough() and similar functions during for instance transform_ip() a recursive lock is needed.
Created attachment 337841 [details] [review] basetransform: Fix race when toggling passthrough
Review of attachment 337841 [details] [review]: I'm worried of the performance impact of this here. Wouldn't it be better to remember passthrough throughout the processing of a single buffer at the very beginning, and not allow changing it on the way? This doesn't seem like something meaningful to do anyway. Or I'm misunderstanding the problem here :) ::: libs/gst/base/gstbasetransform.c @@ +2053,3 @@ */ + if (!priv->negotiated && !priv->passthrough && + (bclass->set_caps != NULL)) Shouldn't this here also take the lock?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/197.