Bug#781997: swh-plugins: analogueOsc produces NaN under some conditions

Frank Heckenbach f.heckenbach at fh-soft.de
Mon Apr 6 09:44:42 UTC 2015


Package: swh-plugins
Version: 0.4.15+1-6+fh1
Severity: normal
Tags: upstream patch

The analogueOsc plugin produces NaN under some conditions.

The attached test program (linking directly to the plugin for
simplicity, but it's the same when loading it dynamically), running
on amd64, shows the bug:

% gcc osc-test.c /usr/lib/ladspa/analogue_osc_1416.so -Wl,-R/usr/lib/ladspa && ./a.out
NaN 45602

The bug is due to a 0.0/0.0 division. Ironically, the code checks
for "the case where x ~= q", but misses the case where x == q
exactly, since nan, unlike inf, is not greater than anything.
Of course, according to Murphy's law, FP numbers are never equal,
unless you want them to be unequal. ;)

I had used the plugin for years on x86 and never seen this problem.
The difference might be due to the extended precision of the x87 vs.
XMM registers.

The attached patch fixes this particular problem. I'm not sure if
checking isnan() is really the best solution, but it's least
invasive and won't break anything else.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osc-test.c
Type: text/x-csrc
Size: 593 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20150406/34b8ac79/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osc-nan.patch
Type: text/x-diff
Size: 400 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20150406/34b8ac79/attachment.patch>


More information about the pkg-multimedia-maintainers mailing list