mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
lavu/eval: handle div by zero in mod().
Similarly to 03f5043f5
, we use the FTRAPV config setting.
This commit is contained in:
parent
aa86d2d884
commit
49a78e6b8c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user