[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 04/05: math: fix for index lookup of fast_a
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 04/05: math: fix for index lookup of fast_atan2f; prevents a segfault when x=inf and y=inf. |
Date: |
Tue, 18 Mar 2014 17:51:31 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch maint
in repository gnuradio.
commit 5764b7959ab7052b0afd61d887f37fccf4cd6965
Author: Sylvain Munaut <address@hidden>
Date: Tue Mar 18 11:31:27 2014 -0400
math: fix for index lookup of fast_atan2f; prevents a segfault when x=inf
and y=inf.
---
gnuradio-runtime/lib/math/fast_atan2f.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gnuradio-runtime/lib/math/fast_atan2f.cc
b/gnuradio-runtime/lib/math/fast_atan2f.cc
index 2cafeec..20e21be 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 */