diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-01 06:24:45 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-01 06:24:45 +0400 |
commit | d2101bffa0f2221586e3e7eacfecf47d5c29f2c4 (patch) | |
tree | b10a697ee7fec90e192df5e9a13e50b22a3411f9 /libavutil | |
parent | 79ae084e9b930f8b53ae0499c6a06636d194574d (diff) |
eval: fix infinite loop on opensolaris x86.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/eval.c b/libavutil/eval.c index 7c3e182509..43c70f396f 100644 --- a/libavutil/eval.c +++ b/libavutil/eval.c @@ -201,7 +201,7 @@ static double eval_expr(Parser *p, AVExpr *e) return d; } case e_root: { - int i; + int i, j; double low = -1, high = -1, v, low_v = -DBL_MAX, high_v = DBL_MAX; double var0 = p->var[0]; double x_max = eval_expr(p, e->param[1]); @@ -224,7 +224,7 @@ static double eval_expr(Parser *p, AVExpr *e) high_v = v; } if (low>=0 && high>=0){ - while (1) { + for (j=0; j<1000; j++) { p->var[0] = (low+high)*0.5; if (low == p->var[0] || high == p->var[0]) break; |