[vlc-commits] text_renderer/freetype: fix SIGSEGV in harfbuzz

Filip Roséen git at videolan.org
Sun Dec 16 21:46:51 CET 2018


vlc/vlc-3.0 | branch: master | Filip Roséen <filip at 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 <thomas at gllm.fr>
(cherry picked from commit 8c2351eeec3a701facb0d4ad73be44cf61bb6bd2)
Signed-off-by: Jean-Baptiste Kempf <jb at 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 ] );



More information about the vlc-commits mailing list