[FFmpeg-cvslog] avformat/bintext: protect against potential overflow of chars_per_frame

Michael Niedermayer git at videolan.org
Mon Oct 21 23:48:55 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Oct 21 23:19:04 2013 +0200| [7e3e653618a59960b4c358e333ba2c0d21929e33] | committer: Michael Niedermayer

avformat/bintext: protect against potential overflow of chars_per_frame

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavformat/bintext.c b/libavformat/bintext.c
index d504607..d50a8d9 100644
--- a/libavformat/bintext.c
+++ b/libavformat/bintext.c
@@ -65,7 +65,7 @@ static AVStream * init_stream(AVFormatContext *s)
     avpriv_set_pts_info(st, 60, bin->framerate.den, bin->framerate.num);
 
     /* simulate tty display speed */
-    bin->chars_per_frame = FFMAX(av_q2d(st->time_base) * bin->chars_per_frame, 1);
+    bin->chars_per_frame = av_clip(av_q2d(st->time_base) * bin->chars_per_frame, 1, INT_MAX);
 
     return st;
 }



More information about the ffmpeg-cvslog mailing list