[vlc-commits] text_renderer: freetype: don't fail on line with empty bitmap (fix #18365)
Francois Cartegnie
git at videolan.org
Mon Jun 5 20:52:48 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jun 2 18:49:15 2017 +0200| [f95b3d9e846107a55d12e8af0357d8b8cf2b59d8] | committer: Francois Cartegnie
text_renderer: freetype: don't fail on line with empty bitmap (fix #18365)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f95b3d9e846107a55d12e8af0357d8b8cf2b59d8
---
modules/text_renderer/freetype/text_layout.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index 4cbf1ef250..d0d0f60aea 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -1340,6 +1340,13 @@ static int LayoutParagraph( filter_t *p_filter, paragraph_t *p_paragraph,
i_total_width += p_paragraph->p_glyph_bitmaps[ i ].i_x_advance;
}
+ if( i_total_width == 0 )
+ {
+ for( int i=0; i < p_paragraph->i_size; ++i )
+ ReleaseGlyphBitMaps( &p_paragraph->p_glyph_bitmaps[ i ] );
+ return VLC_SUCCESS;
+ }
+
int i_line_count = i_total_width / i_max_width + 1;
i_preferred_width = i_total_width / i_line_count;
More information about the vlc-commits
mailing list