[FFmpeg-cvslog] avutil/parseutils: do no rely on av_d2q returning higher num/den than allowed in av_parse_video_rate

Marton Balint git at videolan.org
Sat Nov 16 22:16:09 EET 2024


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Nov 10 15:25:26 2024 +0100| [25efe34e6f1353b50c147098355250e2f401ca33] | committer: Marton Balint

avutil/parseutils: do no rely on av_d2q returning higher num/den than allowed in av_parse_video_rate

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25efe34e6f1353b50c147098355250e2f401ca33
---

 libavutil/parseutils.c | 3 +++
 1 file changed, 3 insertions(+)

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;



More information about the ffmpeg-cvslog mailing list