Commit f53c706b authored by Francois Cartegnie's avatar Francois Cartegnie

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

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