提交 7e3e6536 编写于 作者: M Michael Niedermayer

avformat/bintext: protect against potential overflow of chars_per_frame

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 c9660999
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册