aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-09-24 12:58:42 +0200
committerSean McGovern <gseanmcg@gmail.com>2017-09-24 12:58:42 +0200
commitec683ed527cef9aad208d1daeb10d0e7fb63e75e (patch)
tree1581e2c01019551a12700b908944d8468ffe557e /libavformat
parent9e361022782514d4d4ce97b9c9d5a7863a2de519 (diff)
downloadffmpeg-ec683ed527cef9aad208d1daeb10d0e7fb63e75e.tar.gz
smacker: fix integer overflow with pts_inc
Bug-Id: 1073 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/smacker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 56c909bc06..304e746a91 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -117,6 +117,11 @@ static int smacker_read_header(AVFormatContext *s)
smk->height = avio_rl32(pb);
smk->frames = avio_rl32(pb);
smk->pts_inc = (int32_t)avio_rl32(pb);
+ if (smk->pts_inc > INT_MAX / 100) {
+ av_log(s, AV_LOG_ERROR, "pts_inc %d is too large\n", smk->pts_inc);
+ return AVERROR_INVALIDDATA;
+ }
+
smk->flags = avio_rl32(pb);
if(smk->flags & SMACKER_FLAG_RING_FRAME)
smk->frames++;