You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
opt: reject denominator zero as out of range
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
@@ -97,7 +97,7 @@ static int read_number(const AVOption *o, const void *dst, double *num, int *den
|
||||
static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)
|
||||
{
|
||||
if (o->type != AV_OPT_TYPE_FLAGS &&
|
||||
(o->max * den < num * intnum || o->min * den > num * intnum)) {
|
||||
(!den || o->max * den < num * intnum || o->min * den > num * intnum)) {
|
||||
num = den ? num * intnum / den : (num * intnum ? INFINITY : NAN);
|
||||
av_log(obj, AV_LOG_ERROR, "Value %f for parameter '%s' out of range [%g - %g]\n",
|
||||
num, o->name, o->min, o->max);
|
||||
|
Reference in New Issue
Block a user