vlc/vlc-3.0 | branch: master | Filip Roséen <fi...@atch.se> | Fri Sep 28 
18:18:13 2018 +0200| [5d3c9d55a87dba3d2dbf57fb77913a16f0acf38d] | committer: 
Jean-Baptiste Kempf

text_renderer/freetype: fix SIGSEGV in harfbuzz

There is no documentation but that is how they do it in their tests:
https://github.com/harfbuzz/harfbuzz/blob/master/test/api/test-unicode.c#L587

Signed-off-by: Thomas Guillem <tho...@gllm.fr>
(cherry picked from commit 8c2351eeec3a701facb0d4ad73be44cf61bb6bd2)
Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

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

diff --git a/modules/text_renderer/freetype/text_layout.c 
b/modules/text_renderer/freetype/text_layout.c
index 3aba1b820b..ab95466ff6 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -395,7 +395,8 @@ static int AnalyzeParagraph( paragraph_t *p_paragraph )
 #endif
 
 #ifdef HAVE_HARFBUZZ
-    hb_unicode_funcs_t *p_funcs = hb_unicode_funcs_get_default();
+    hb_unicode_funcs_t *p_funcs =
+        hb_unicode_funcs_create( hb_unicode_funcs_get_default() );
     for( int i = 0; i < p_paragraph->i_size; ++i )
         p_paragraph->p_scripts[ i ] =
             hb_unicode_script( p_funcs, p_paragraph->p_code_points[ i ] );

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to