diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-03 21:36:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-04-13 00:35:15 +0200 |
commit | 8a89cce372884c38c6f22eede59c43f486b83394 (patch) | |
tree | ba95987017852fdab2be33b73e4dfd13a9a1721a | |
parent | 899d40c17fefe7f7a0ba7f7a95ae61be81b6d0ad (diff) | |
download | ffmpeg-8a89cce372884c38c6f22eede59c43f486b83394.tar.gz |
avformat/mov: Move +1 in check to avoid hypothetical overflow in add_ctts_entry()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit eb60b9d3aaaa42265fb1960be6fff6383cfdbf37)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 6124b0b573..b60f8f0eac 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2970,7 +2970,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); |