[pulseaudio-discuss] [PATCH] core-util: Filter out not-a-numbers in pa_atod()

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Fri Apr 10 03:55:42 PDT 2015

On Fri, 2015-04-10 at 12:41 +0200, David Henningsson wrote:
> Ack, but add isinf too while you're at it?

I thought about that, but inf needs to be supported at least for decibel
volume parsing, so I decided not to filter those out. Allowing them is
also less prone to bugs than allowing NaN, because this kind of range
checks behave as expected:

if (d < 0 || d > max_allowed)
    goto fail;

If d is -inf or inf, that check works fine, but if d is NaN, the range
check doesn't fail as it should.


More information about the pulseaudio-discuss mailing list