[FFmpeg-devel] [PATCH] opt: reject denominator zero as out of range

Michael Niedermayer michael at niedermayer.cc
Mon Dec 12 04:39:06 EET 2016


On Mon, Dec 12, 2016 at 01:31:47AM +0100, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavutil/opt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavutil/opt.c b/libavutil/opt.c
> index f855ccb..6ae2af6 100644
> --- a/libavutil/opt.c
> +++ b/libavutil/opt.c
> @@ -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)) {

probably ok
(i assume we dont want/need to have 1/0 and max=infinity )

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161212/52e446a3/attachment.sig>


More information about the ffmpeg-devel mailing list