summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2014-03-18 11:31:27 -0400
committerTom Rondeau <tom@trondeau.com>2014-03-18 11:31:27 -0400
commit5764b7959ab7052b0afd61d887f37fccf4cd6965 (patch)
tree3a51363dbe04efdc1ef90074c5f030d9e869da32
parente3c403691b97d86f6e08fd194d46147f572ed6ed (diff)
math: fix for index lookup of fast_atan2f; prevents a segfault when x=inf and y=inf.
-rw-r--r--gnuradio-runtime/lib/math/fast_atan2f.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnuradio-runtime/lib/math/fast_atan2f.cc b/gnuradio-runtime/lib/math/fast_atan2f.cc
index 2cafeec520..20e21be32b 100644
--- a/gnuradio-runtime/lib/math/fast_atan2f.cc
+++ b/gnuradio-runtime/lib/math/fast_atan2f.cc
@@ -148,7 +148,7 @@ namespace gr {
else {
/* find index and interpolation value */
alpha = z * (float)TAN_MAP_SIZE - .5;
- index = (int)alpha;
+ index = (int)alpha & 0xff;
alpha -= (float)index;
/* determine base angle based on quadrant and */
/* add or subtract table value from base angle based on quadrant */