[FFmpeg-cvslog] avformat/mov: Move +1 in check to avoid hypothetical overflow in add_ctts_entry()

2018-04-12 Thread Michael Niedermayer
ffmpeg | branch: release/3.3 | Michael Niedermayer  | 
Sat Feb  3 21:36:22 2018 +0100| [8a89cce372884c38c6f22eede59c43f486b83394] | 
committer: Michael Niedermayer

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

Signed-off-by: Michael Niedermayer 
(cherry picked from commit eb60b9d342265fb1960be6fff6383cfdbf37)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a89cce372884c38c6f22eede59c43f486b83394
---

 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/mov: Move +1 in check to avoid hypothetical overflow in add_ctts_entry()

2018-03-25 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Feb  3 21:36:22 2018 +0100| [eb60b9d342265fb1960be6fff6383cfdbf37] | 
committer: Michael Niedermayer

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

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eb60b9d342265fb1960be6fff6383cfdbf37
---

 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog