[vlc-commits] freetype: check fribidi return code
Francois Cartegnie
git at videolan.org
Mon Aug 17 23:43:03 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Aug 13 13:54:56 2020 +0200| [398dc973b02225af7e9eb257d9b6e676c8e367a2] | committer: Francois Cartegnie
freetype: check fribidi return code
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=398dc973b02225af7e9eb257d9b6e676c8e367a2
---
modules/text_renderer/freetype/text_layout.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index c3f5072854..0f579d617b 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -428,6 +428,7 @@ static void FreeParagraph( paragraph_t *p_paragraph )
#ifdef HAVE_FRIBIDI
static int AnalyzeParagraph( paragraph_t *p_paragraph )
{
+ int i_max;
fribidi_get_bidi_types( p_paragraph->p_code_points,
p_paragraph->i_size,
p_paragraph->p_types );
@@ -436,17 +437,21 @@ static int AnalyzeParagraph( paragraph_t *p_paragraph )
p_paragraph->i_size,
p_paragraph->p_types,
p_paragraph->p_btypes );
- fribidi_get_par_embedding_levels_ex( p_paragraph->p_types,
+ i_max = fribidi_get_par_embedding_levels_ex(
+ p_paragraph->p_types,
p_paragraph->p_btypes,
p_paragraph->i_size,
&p_paragraph->paragraph_type,
p_paragraph->p_levels );
#else
- fribidi_get_par_embedding_levels( p_paragraph->p_types,
+ i_max = fribidi_get_par_embedding_levels(
+ p_paragraph->p_types,
p_paragraph->i_size,
&p_paragraph->paragraph_type,
p_paragraph->p_levels );
#endif
+ if( i_max == 0 )
+ return VLC_EGENERIC;
#ifdef HAVE_HARFBUZZ
hb_unicode_funcs_t *p_funcs =
More information about the vlc-commits
mailing list