summaryrefslogtreecommitdiff
path: root/src/opus_encoder.c
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-12-09 21:56:21 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-12-09 21:56:21 -0500
commit15edb78b3e12d2b5c94e2354c91f354c881627de (patch)
tree1880716dfd3369dc66452bbbb3de54c49f4d66a2 /src/opus_encoder.c
parent4fda6b01424aab5f6c5b13b1bd01697c899b6fcd (diff)
downloadopus-15edb78b3e12d2b5c94e2354c91f354c881627de.tar.gz
Making NaN detection more robust to -ffast-math.
Diffstat (limited to 'src/opus_encoder.c')
-rw-r--r--src/opus_encoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index c819bb15..411e3d24 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1452,7 +1452,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
sum = celt_inner_prod(&pcm_buf[total_buffer*st->channels], &pcm_buf[total_buffer*st->channels], frame_size*st->channels);
/* This should filter out both NaNs and ridiculous signals that could
cause NaNs further down. */
- if (!(sum < 1e9))
+ if (!(sum < 1e9) || celt_isnan(sum))
OPUS_CLEAR(&pcm_buf[total_buffer*st->channels], frame_size*st->channels);
}
#endif