mirror of https://git.ffmpeg.org/ffmpeg.git
avutil/parseutils: do no rely on av_d2q returning higher num/den than allowed in av_parse_video_rate
This commit is contained in:
parent
e9af7b7b5d
commit
25efe34e6f
|
@ -193,6 +193,9 @@ int av_parse_video_rate(AVRational *rate, const char *arg)
|
||||||
/* Then, we try to parse it as fraction */
|
/* Then, we try to parse it as fraction */
|
||||||
if ((ret = av_parse_ratio_quiet(rate, arg, 1001000)) < 0)
|
if ((ret = av_parse_ratio_quiet(rate, arg, 1001000)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
if (!rate->num || !rate->den)
|
||||||
|
if ((ret = av_parse_ratio_quiet(rate, arg, INT_MAX)) < 0)
|
||||||
|
return ret;
|
||||||
if (rate->num <= 0 || rate->den <= 0)
|
if (rate->num <= 0 || rate->den <= 0)
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue