Commit eb60b9d3 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mov: Move +1 in check to avoid hypothetical overflow in add_ctts_entry()

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent e529fe76
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment