[Mesa-dev] [PATCH] tgsi: fix parsing nan float inputs
Ilia Mirkin
imirkin at alum.mit.edu
Mon Oct 10 16:12:38 UTC 2016
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/gallium/auxiliary/tgsi/tgsi_text.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
index be80842..36dc979 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
@@ -257,8 +257,13 @@ static boolean parse_float( const char **pcur, float *val )
cur++;
}
}
- if (!integral_part && !fractional_part)
+ if (!integral_part && !fractional_part) {
+ if (uprcase(*cur++) == 'N' &&
+ uprcase(*cur++) == 'A' &&
+ uprcase(*cur++) == 'N')
+ goto out;
return FALSE;
+ }
if (uprcase( *cur ) == 'E') {
cur++;
if (*cur == '-' || *cur == '+')
--
2.7.3
More information about the mesa-dev
mailing list