Commit f53c706b authored by Francois Cartegnie's avatar Francois Cartegnie

codec: subsdec: fix div by zero (cid #1346941)

parent a84002ca
......@@ -798,10 +798,14 @@ static text_segment_t* ParseSubtitles( int *pi_align, const char *psz_subtitle )
}
else if ( !strcasecmp( psz_attribute_name, "size" ) )
{
p_segment->style->i_font_size = atoi( psz_attribute_value );
int size = atoi( psz_attribute_value );
if( size )
{
p_segment->style->i_font_size = size;
p_segment->style->f_font_relsize = STYLE_DEFAULT_REL_FONT_SIZE *
STYLE_DEFAULT_FONT_SIZE / p_segment->style->i_font_size;
}
}
else if ( !strcasecmp( psz_attribute_name, "color" ) )
{
p_segment->style->i_font_color = vlc_html_color( psz_attribute_value, NULL );
......
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