diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-09-05 13:35:01 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-09-05 13:35:01 +0000 |
commit | 794181964eaa304a325f80ef6af300fc12d6073e (patch) | |
tree | 2b96f50af2998187131df2e23bf94c5f42423444 | |
parent | ac1206e146b5643263054f0bcccf08261558017e (diff) |
Ticket #612: division by zero in pjlib stddev calculation causes crash/floating point exception in pjsua "dq" command on ARM platform
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2263 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjlib/include/pj/math.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pjlib/include/pj/math.h b/pjlib/include/pj/math.h index c8f7ce48..9d7653ec 100644 --- a/pjlib/include/pj/math.h +++ b/pjlib/include/pj/math.h @@ -167,6 +167,7 @@ PJ_INLINE(void) pj_math_stat_update(pj_math_stat *stat, int val) */ PJ_INLINE(unsigned) pj_math_stat_get_stddev(pj_math_stat *stat) { + if (stat->n == 0) return 0; return (pj_isqrt((unsigned)(stat->m2_/stat->n))); } |