On Thu, 2015-12-31 at 09:42 +0530, arun at accosted.net wrote: > From: Arun Raghavan <git at arunraghavan.net> > > We should do stricter validation when we can. > --- > Â src/pulse/format.c | 8 +++++++- > Â 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/src/pulse/format.c b/src/pulse/format.c > index c2a1552..b07940a 100644 > --- a/src/pulse/format.c > +++ b/src/pulse/format.c > @@ -101,7 +101,13 @@ void pa_format_info_free(pa_format_info *f) { > Â } > Â > Â int pa_format_info_valid(const pa_format_info *f) { > -Â Â Â Â return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL); > +Â Â Â Â pa_sample_spec ss; > + > +Â Â Â Â if (pa_format_info_is_pcm(f)) { > +Â Â Â Â Â Â Â Â pa_format_info_to_sample_spec(f, &ss, NULL); > +Â Â Â Â Â Â Â Â return pa_sample_spec_valid(&ss); > +Â Â Â Â } else > +Â Â Â Â Â Â Â Â return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL); > Â } > Â > Â int pa_format_info_is_pcm(const pa_format_info *f) { Looks good to me, and this seems appropriate for 8.0 too. --Â Tanu