[FFmpeg-cvslog] fftools/ffmpeg_opt: Fix signed integer overflow

Andreas Rheinhardt git at videolan.org
Fri Jul 3 16:09:48 EEST 2020


ffmpeg | branch: release/3.3 | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Mon Sep 16 17:55:01 2019 +0200| [5f288e1b29b2fa8f7c2b6f437d986b2e1f73fa51] | committer: Andreas Rheinhardt

fftools/ffmpeg_opt: Fix signed integer overflow

Fixes ticket #8154.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 2b1fcba8ddcb7d29299ea28403fb597640a7288b)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

 ffmpeg_opt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 5f53a7a89d..2600d314cd 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1,3 +1,4 @@
+
 /*
  * ffmpeg option parsing
  *
@@ -2702,13 +2703,14 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
     } else {
         /* Try to determine PAL/NTSC by peeking in the input files */
         if (nb_input_files) {
-            int i, j, fr;
+            int i, j;
             for (j = 0; j < nb_input_files; j++) {
                 for (i = 0; i < input_files[j]->nb_streams; i++) {
                     AVStream *st = input_files[j]->ctx->streams[i];
+                    int64_t fr;
                     if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
                         continue;
-                    fr = st->time_base.den * 1000 / st->time_base.num;
+                    fr = st->time_base.den * 1000LL / st->time_base.num;
                     if (fr == 25000) {
                         norm = PAL;
                         break;



More information about the ffmpeg-cvslog mailing list