]> git.sesse.net Git - vlc/commitdiff
zvbi: return actual last visible row
authorHannes Domani <ssbssa@yahoo.de>
Mon, 15 Sep 2014 14:50:36 +0000 (16:50 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 17 Sep 2014 06:21:48 +0000 (08:21 +0200)
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: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/zvbi.c

index 209c64ffb5b88a4c4ea6d6ecb59c2235944158b3..a30d0bde0b7858ed6c4bf35ac7304fba8c5d9a93 100644 (file)
@@ -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)
         {
-            return ( i + columns - 1) / columns;
+            return i / columns;
         }
     }