Commit 3810606e authored by Marvin Scholz's avatar Marvin Scholz Committed by Thomas Guillem

text_renderer/freetype: Fix uninitialized usage of i_max_face_height

Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 0151a4fd
......@@ -1229,13 +1229,6 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
else if( p_region_in->i_y > 0 && (unsigned)p_region_in->i_y < i_max_height )
i_max_height -= p_region_in->i_y;
uint8_t i_background_opacity = var_InheritInteger( p_filter, "freetype-background-opacity" );
i_background_opacity = VLC_CLIP( i_background_opacity, 0, 255 );
int i_margin = (i_background_opacity > 0 && !p_region_in->b_gridmode) ? i_max_face_height / 4 : 0;
if( (unsigned)i_margin * 2 >= i_max_width || (unsigned)i_margin * 2 >= i_max_height )
i_margin = 0;
text_block.i_max_width = i_max_width;
text_block.i_max_height = i_max_height;
rv = LayoutTextBlock( p_filter, &text_block, &text_block.p_laid, &bbox, &i_max_face_height );
......@@ -1247,6 +1240,13 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
const vlc_fourcc_t p_chroma_list_yuvp[] = { VLC_CODEC_YUVP, 0 };
const vlc_fourcc_t p_chroma_list_rgba[] = { VLC_CODEC_RGBA, 0 };
uint8_t i_background_opacity = var_InheritInteger( p_filter, "freetype-background-opacity" );
i_background_opacity = VLC_CLIP( i_background_opacity, 0, 255 );
int i_margin = (i_background_opacity > 0 && !p_region_in->b_gridmode) ? i_max_face_height / 4 : 0;
if( (unsigned)i_margin * 2 >= i_max_width || (unsigned)i_margin * 2 >= i_max_height )
i_margin = 0;
if( var_InheritBool( p_filter, "freetype-yuvp" ) )
p_chroma_list = p_chroma_list_yuvp;
else if( !p_chroma_list || *p_chroma_list == 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment