diff options
author | Clément Bœsch | 2013-01-02 22:50:56 +0100 |
---|---|---|
committer | Clément Bœsch | 2013-01-02 23:15:45 +0100 |
commit | 49a78e6b8cbd83d070920b8250a4cf58a6b70d8e (patch) | |
tree | b159faf8318baa7230c98de19b3e23347dab815c /libavutil | |
parent | aa86d2d8846155ccdbb6f8824294a548fe42dfc2 (diff) |
lavu/eval: handle div by zero in mod().
Similarly to 03f5043f5, we use the FTRAPV config setting.
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/eval.c b/libavutil/eval.c index b41c95c838..6687b646f5 100644 --- a/libavutil/eval.c +++ b/libavutil/eval.c @@ -253,7 +253,7 @@ static double eval_expr(Parser *p, AVExpr *e) double d = eval_expr(p, e->param[0]); double d2 = eval_expr(p, e->param[1]); switch (e->type) { - case e_mod: return e->value * (d - floor(d/d2)*d2); + case e_mod: return e->value * (d - floor((!CONFIG_FTRAPV || d2) ? d / d2 : d * INFINITY) * d2); case e_gcd: return e->value * av_gcd(d,d2); case e_max: return e->value * (d > d2 ? d : d2); case e_min: return e->value * (d < d2 ? d : d2); |