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

Francois Cartegnie git at videolan.org
Sun Jul 1 22:55:28 CEST 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Feb  9 11:25:57 2018 +0100| [9e44dfcc6dc465b5da75b7c375c5d7492206eb22] | committer: Jean-Baptiste Kempf

text_renderer: freetype: init indices on alloc

(cherry picked from commit 6335f1e34c45f1476c0f331fe3f4ccf7a380ba90)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9e44dfcc6dc465b5da75b7c375c5d7492206eb22
---

 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 4946b3254e..983a7030a1 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -303,6 +303,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;
@@ -1370,9 +1373,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