[FFmpeg-cvslog] eval: fix infinite loop on opensolaris x86.
Michael Niedermayer
git at videolan.org
Thu Mar 1 03:42:42 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Mar 1 03:24:45 2012 +0100| [d2101bffa0f2221586e3e7eacfecf47d5c29f2c4] | committer: Michael Niedermayer
eval: fix infinite loop on opensolaris x86.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d2101bffa0f2221586e3e7eacfecf47d5c29f2c4
---
libavutil/eval.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavutil/eval.c b/libavutil/eval.c
index 7c3e182..43c70f3 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;
More information about the ffmpeg-cvslog
mailing list