diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-02 02:16:41 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-16 00:45:22 +0100 |
commit | 483b2016bb70c1170383d8710433bed144e5706f (patch) | |
tree | a58e3e23b79e0b4b88a0d3234e32c2655d4c2cd2 /libavcodec | |
parent | 271f5d68b922174e5b49df9778c89ee76b105c60 (diff) | |
download | ffmpeg-483b2016bb70c1170383d8710433bed144e5706f.tar.gz |
avcodec/ansi: Fix right/bottom end checks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6021615bbe393381f23b34a7cd0dcfd1a42687ba)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ansi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index 655c86970c..bd28a77be9 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -112,7 +112,7 @@ static void hscroll(AVCodecContext *avctx) AnsiContext *s = avctx->priv_data; int i; - if (s->y < avctx->height - s->font_height) { + if (s->y <= avctx->height - 2*s->font_height) { s->y += s->font_height; return; } @@ -165,7 +165,7 @@ static void draw_char(AVCodecContext *avctx, int c) ff_draw_pc_font(s->frame.data[0] + s->y * s->frame.linesize[0] + s->x, s->frame.linesize[0], s->font, s->font_height, c, fg, bg); s->x += FONT_WIDTH; - if (s->x >= avctx->width) { + if (s->x > avctx->width - FONT_WIDTH) { s->x = 0; hscroll(avctx); } |