aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2024-11-10 15:25:26 +0100
committerMarton Balint <cus@passwd.hu>2024-11-16 20:58:49 +0100
commit25efe34e6f1353b50c147098355250e2f401ca33 (patch)
tree4528a198d471af09884580e70620c353b7133710
parente9af7b7b5d386f6d480497c856e4205d0550bd88 (diff)
downloadffmpeg-25efe34e6f1353b50c147098355250e2f401ca33.tar.gz
avutil/parseutils: do no rely on av_d2q returning higher num/den than allowed in av_parse_video_rate
-rw-r--r--libavutil/parseutils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 94e88e0a79..9f57b16ec2 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -193,6 +193,9 @@ int av_parse_video_rate(AVRational *rate, const char *arg)
/* Then, we try to parse it as fraction */
if ((ret = av_parse_ratio_quiet(rate, arg, 1001000)) < 0)
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)
return AVERROR(EINVAL);
return 0;