[FFmpeg-devel] [PATCH 1/2] eval: safe and restore LD(0) value in taylor().

Michael Niedermayer michaelni at gmx.at
Tue Feb 21 22:34:48 CET 2012


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavutil/eval.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavutil/eval.c b/libavutil/eval.c
index 8f83b36..0ad1f3d 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -185,6 +185,7 @@ static double eval_expr(Parser *p, AVExpr *e)
             double t = 1, d = 0, v;
             double x = eval_expr(p, e->param[1]);
             int i;
+            double var0 = p->var[0];
             for(i=0; i<1000; i++) {
                 double ld = d;
                 p->var[0] = i;
@@ -194,6 +195,7 @@ static double eval_expr(Parser *p, AVExpr *e)
                     break;
                 t *= x / (i+1);
             }
+            p->var[0] = var0;
             return d;
         }
         default: {
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list