GNOME Bugzilla – Bug 719524
audiofxbaseiirfilter: check if coefficients are provided inside filter lock
Last modified: 2014-02-22 19:06:36 UTC
In transform_ip the filter coefficients are checked outside of the lock so it's possible for the values to be NULL. Move the check inside the lock.
Created attachment 263164 [details] [review] Patch for bug report Sorry, looks like I forgot to attach the patch.
I think the if (filter->a == NULL || filter->b == NULL) { check is there to prevent a programming error. IMHO we should ensure that the value is != NULL when chaning the value, e.g. in gst_audio_fx_base_iir_filter_set_coefficients().
The check is valid but it occurs outside the lock so while it's not possible to call filter->process while the variables are NULL it is possible for the check to fail if gst_audio_fx_base_iir_filter_set_coefficients is called while playing. Moving the check inside the lock prevents the race condition from occurring.
Right, this is better then having the race. An alternative could the to not allow setting a/b to NULL via gst_audio_fx_base_iir_filter_set_coefficients(). Applying the patch for now.
The following fix has been pushed: 7a65277 audiofxbaseiirfilter: check if coefficients are provided inside filter lock
Created attachment 270003 [details] [review] audiofxbaseiirfilter: check if coefficients are provided inside filter lock