[vlc-commits] text_renderer: freetype: init indices on alloc

Francois Cartegnie git at videolan.org
Thu Feb 15 10:14:44 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Feb  9 11:25:57 2018 +0100| [6335f1e34c45f1476c0f331fe3f4ccf7a380ba90] | committer: Francois Cartegnie

text_renderer: freetype: init indices on alloc

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

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

diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index fca7e0b3b6..bcdc2474ae 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -297,6 +297,9 @@ static paragraph_t *NewParagraph( filter_t *p_filter,
      || !p_paragraph->pi_reordered_indices )
         goto error;
 
+    for( int i=0; i<i_size; i++ )
+        p_paragraph->pi_reordered_indices[i] = i;
+
     int i_direction = var_InheritInteger( p_filter, "freetype-text-direction" );
     if( i_direction == 0 )
         p_paragraph->paragraph_type = FRIBIDI_PAR_LTR;
@@ -1349,9 +1352,6 @@ static int LayoutParagraph( filter_t *p_filter, paragraph_t *p_paragraph,
 
     for( int i = 0; i < p_paragraph->i_size; ++i )
     {
-#ifdef HAVE_FRIBIDI
-        p_paragraph->pi_reordered_indices[ i ] = i;
-#endif
         if( !IsWhitespaceAt( p_paragraph, i ) || i != i_last_space + 1 )
             i_total_width += p_paragraph->p_glyph_bitmaps[ i ].i_x_advance;
         else



More information about the vlc-commits mailing list