Commit 59c8ec8a authored by Hannes Domani's avatar Hannes Domani Committed by Jean-Baptiste Kempf

zvbi: return actual last visible row

Currently in most cases the row after the last is returned.
When the last row is visible vbi_draw_vt_page_region() could
crash, because it went over the size of p_page.text and use
invalid values (>=40) as index for p_page.color_map.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent de5710e5
...@@ -605,7 +605,7 @@ static int get_last_visible_row( vbi_char *p_text, int rows, int columns) ...@@ -605,7 +605,7 @@ static int get_last_visible_row( vbi_char *p_text, int rows, int columns)
{ {
if (p_text[i].opacity != VBI_TRANSPARENT_SPACE) if (p_text[i].opacity != VBI_TRANSPARENT_SPACE)
{ {
return ( i + columns - 1) / columns; return i / columns;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment