[vlc-commits] text_renderer: freetype: fix off by one char for > 2nd background

Francois Cartegnie git at videolan.org
Fri Jan 27 16:15:43 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 27 15:51:27 2017 +0100| [4c8a62320fb000f331c17a908ec442b6d06b1b72] | committer: Francois Cartegnie

text_renderer: freetype: fix off by one char for > 2nd background

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4c8a62320fb000f331c17a908ec442b6d06b1b72
---

 modules/text_renderer/freetype/freetype.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index de833a2..4f06894 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -765,8 +765,8 @@ static inline void RenderBackground( subpicture_region_t *p_region,
         {
             /* find last char having the same style */
             int i_seg_end = i_char_index;
-            while( i_seg_end < p_line->i_last_visible_char_index &&
-                   p_prev_style == p_line->p_character[i_seg_end].p_style )
+            while( i_seg_end + 1 <= p_line->i_last_visible_char_index &&
+                   p_prev_style == p_line->p_character[i_seg_end + 1].p_style )
             {
                 i_seg_end++;
             }



More information about the vlc-commits mailing list