[vlc-commits] text_renderer: freetype: fix oob

Francois Cartegnie git at videolan.org
Wed Jun 7 10:25:02 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jun  7 10:22:32 2017 +0200| [5d9922930e6a049002654eaec5a3eb3280a250df] | committer: Francois Cartegnie

text_renderer: freetype: fix oob

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

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

diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index f9282e731d..a735148301 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -1364,8 +1364,6 @@ static int LayoutParagraph( filter_t *p_filter, paragraph_t *p_paragraph,
 
     for( int i = 0; i <= p_paragraph->i_size; ++i )
     {
-        const run_desc_t *p_run = &p_paragraph->p_runs[p_paragraph->pi_run_ids[i]];
-
         if( i == p_paragraph->i_size )
         {
             if( i_line_start < i )
@@ -1405,6 +1403,8 @@ static int LayoutParagraph( filter_t *p_filter, paragraph_t *p_paragraph,
             i_last_space_width = i_width;
         }
 
+        const run_desc_t *p_run = &p_paragraph->p_runs[p_paragraph->pi_run_ids[i]];
+
         i_width += p_paragraph->p_glyph_bitmaps[ i ].i_x_advance;
 
         if( ( i_last_space_width >= i_preferred_width && p_run->p_style->e_wrapinfo == STYLE_WRAP_DEFAULT )



More information about the vlc-commits mailing list