diff mbox

[FFmpeg-devel,4/5] fftools/ffmpeg_opt: Fix signed integer overflow

Message ID 20190916155502.17579-4-andreas.rheinhardt@gmail.com
State Accepted
Commit 2b1fcba8ddcb7d29299ea28403fb597640a7288b
Headers show

Commit Message

Andreas Rheinhardt Sept. 16, 2019, 3:55 p.m. UTC
Fixes ticket #8154.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 fftools/ffmpeg_opt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer Sept. 17, 2019, 12:55 p.m. UTC | #1
On Mon, Sep 16, 2019 at 05:55:01PM +0200, Andreas Rheinhardt wrote:
> Fixes ticket #8154.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  fftools/ffmpeg_opt.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

will apply

thx

[...]
diff mbox

Patch

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index f5ca18aa64..b2aa63e7ee 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -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;