aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/swfenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-02-16 18:32:31 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-03 12:10:24 +0200
commit6ffdc413d631a555b3b2db5d0df453657276510c (patch)
tree7d9005de41da5e4aa102d09d0f53db5b4bd9f294 /libavformat/swfenc.c
parent862801c68ce2d6f18fda31a5b851f18997e6d54e (diff)
downloadffmpeg-6ffdc413d631a555b3b2db5d0df453657276510c.tar.gz
avformat/swfenc: Fix integer overflow in frame rate handling
Fixes: signed integer overflow: 30000299 * 256 cannot be represented in type 'int' Fixes: ticket8184 Found-by: Suhwan Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 31f956acadd994b8c4e22b714aaffee0f527c827) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/swfenc.c')
-rw-r--r--libavformat/swfenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index f53db0fb2b..877dcfa9cb 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -256,7 +256,7 @@ static int swf_write_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "Invalid (too large) frame rate %d/%d\n", rate, rate_base);
return AVERROR(EINVAL);
}
- avio_wl16(pb, (rate * 256) / rate_base); /* frame rate */
+ avio_wl16(pb, (rate * 256LL) / rate_base); /* frame rate */
swf->duration_pos = avio_tell(pb);
avio_wl16(pb, (uint16_t)(DUMMY_DURATION * (int64_t)rate / rate_base)); /* frame count */