After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791423 - videofilter: Should probably not change class property in set_caps()
videofilter: Should probably not change class property in set_caps()
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-09 21:01 UTC by Nicolas Dufresne (ndufresne)
Modified: 2018-11-03 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nicolas Dufresne (ndufresne) 2017-12-09 21:01:29 UTC
Just stumbled across some code that does not seem quite safe:

gst_video_filter_set_caps():
+ if (fclass->transform_frame_ip == NULL)
+      GST_BASE_TRANSFORM_CLASS (fclass)->transform_ip_on_passthrough = FALSE;

This type of code is normally placed in a class init function I believe. I do expect a class to be generally immutable (except maybe for aa thread safe singleton). At least, I don't think it would be good practice to change the function pointer dynamically in an instance, or change these kind of property.
Comment 1 Sebastian Dröge (slomo) 2017-12-09 23:13:55 UTC
Especially it is actually not safe. Say you have class A inheriting from videofilter and then class B inheriting from class A, and class B actually defines a transform_ip. If class A is doing set_caps() before class B is initialized, transform_ip_on_passthrough is going to be set to FALSE, and that is then inherited by class B once it is initialized. If class B is initialized before class A is doing set_caps(), it would get the previous value of transform_ip_on_passthrough.
Comment 2 GStreamer system administrator 2018-11-03 12:02:03 UTC
-- 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/gst-plugins-base/issues/405.