]> git.sesse.net Git - ffmpeg/commitdiff
fftools/ffmpeg_opt: Fix signed integer overflow
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 16 Sep 2019 15:55:01 +0000 (17:55 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 17 Sep 2019 12:41:07 +0000 (14:41 +0200)
Fixes ticket #8154.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
fftools/ffmpeg_opt.c

index f5ca18aa6442b4f922e26be5cd72da4f7f4ac053..b2aa63e7ee26971a851b519b13a07c66b3c93acb 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * ffmpeg option parsing
  *
@@ -2769,13 +2770,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;