mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
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 eb60b9d3aa
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
26fcff1eb4
commit
9b2ce61155
@ -2979,7 +2979,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);
|
||||
|
Loading…
Reference in New Issue
Block a user