GNOME Bugzilla – Bug 780111
_gst_param_array_validate is not correctly implemented
Last modified: 2017-03-24 17:53:44 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.
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
Attachment 348039 [details] pushed as 1a65d5b - paramspec: Fix array validation logic