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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2015-04-10 12:55, Tanu Kaskinen wrote:
> 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.

Ok, then acked as it is.

>

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux