aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-03-17 11:14:26 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-03-31 23:30:09 +0200
commitad0f4a7d10f91c63cceeb25010bec83311ad84fa (patch)
tree60e398b34ffc3e4d930d857bb01dad0db492c277
parentcb4768e7f20b6bc6eef28266ee9a3361967e65df (diff)
downloadffmpeg-ad0f4a7d10f91c63cceeb25010bec83311ad84fa.tar.gz
avformat/mov: Fix potential integer overflow in entry check in mov_read_trun()
No testcase Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ff13a92a6f8413402f5b3cacedda7c10d350b487) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 60309b4869..caba256161 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4781,7 +4781,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_TRACE, "first sample flags 0x%x\n", first_sample_flags);
// realloc space for new index entries
- if((unsigned)st->nb_index_entries + entries >= UINT_MAX / sizeof(AVIndexEntry)) {
+ if((uint64_t)st->nb_index_entries + entries >= UINT_MAX / sizeof(AVIndexEntry)) {
entries = UINT_MAX / sizeof(AVIndexEntry) - st->nb_index_entries;
av_log(c->fc, AV_LOG_ERROR, "Failed to add index entry\n");
}