aboutsummaryrefslogtreecommitdiffstats
path: root/fftools
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-16 17:55:01 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-01 22:19:39 +0200
commit9744ed6e52ed006e99447a7b4fd53c0057d0d7f1 (patch)
treee2554cd9d6b3f192f5a77a64e7e40fbdd04e9be6 /fftools
parent8ee6b52db0e68f897d9829e51407fb35a90dfe48 (diff)
downloadffmpeg-9744ed6e52ed006e99447a7b4fd53c0057d0d7f1.tar.gz
fftools/ffmpeg_opt: Fix signed integer overflow
Fixes ticket #8154. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2b1fcba8ddcb7d29299ea28403fb597640a7288b) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'fftools')
-rw-r--r--fftools/ffmpeg_opt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index d4851a2cd8..1893234789 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1,3 +1,4 @@
+
/*
* ffmpeg option parsing
*
@@ -2729,13 +2730,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;