summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-03 21:36:22 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-03-26 02:16:48 +0200
commiteb60b9d3aaaa42265fb1960be6fff6383cfdbf37 (patch)
treedec6c5fb874b0fae263974571cca53941d2a6c9d /libavformat/mov.c
parente529fe7633762cb26a665fb6dee3be29b15285cc (diff)
avformat/mov: Move +1 in check to avoid hypothetical overflow in add_ctts_entry()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 33126781a0..cb6f3a45de 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3256,7 +3256,7 @@ static int64_t add_ctts_entry(MOVStts** ctts_data, unsigned int* ctts_count, uns
FFMAX(min_size_needed, 2 * (*allocated_size)) :
min_size_needed;
- if((unsigned)(*ctts_count) + 1 >= UINT_MAX / sizeof(MOVStts))
+ if((unsigned)(*ctts_count) >= UINT_MAX / sizeof(MOVStts) - 1)
return -1;
ctts_buf_new = av_fast_realloc(*ctts_data, allocated_size, requested_size);