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 780111 - _gst_param_array_validate is not correctly implemented
_gst_param_array_validate is not correctly implemented
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.11.2
Other Linux
: Normal major
: 1.11.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 780053
 
 
Reported: 2017-03-15 21:15 UTC by Nicolas Dufresne (ndufresne)
Modified: 2017-03-24 17:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
paramspec: Fix array validation logic (1.64 KB, patch)
2017-03-15 21:33 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2017-03-15 21:15:14 UTC
The param validation function are supposed to fix the data, and return TRUE if the data is changed. The code in _gst_param_array_validate() is instead assuming that FALSE means failure. This breaks bunch of things, including the actual validation or safe mode usage. It also breaks if you try to set an empty array. On that last point, I believe the param_spec should have allowed to define the minimum / maximum size for this array. It will be hard to add later. Finally, this should be unit tested really, it's an easy candidate.

I'll soon post a patch that at least fix the validation logic, I'd like feedback for the min/max (if we decide we want that, then we'll mark this bug as blocker). Any help is appreciated, using the new Array stuff in properties has taken me much more time then expected.
Comment 1 Nicolas Dufresne (ndufresne) 2017-03-15 21:33:49 UTC
Created attachment 348039 [details] [review]
paramspec: Fix array validation logic

A paramspec validation should modify the content to match what the spec
requires and return TURE if a modification happened. This previous
implementation would only fix the first element of the array and return.
It was also return TRUE for empty array, while no modification was
needed.
Comment 2 Nicolas Dufresne (ndufresne) 2017-03-24 17:52:50 UTC
Attachment 348039 [details] pushed as 1a65d5b - paramspec: Fix array validation logic