Commit a2c338bb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Don't rely on scanf when parsing floats from files

(well, you _can_ but you'd need to use uselocale() then)
parent a159f479
...@@ -1468,8 +1468,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) ...@@ -1468,8 +1468,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
free( psz_temp ); free( psz_temp );
} }
/* Data Lines */ /* Data Lines */
if( sscanf (s, "%f %f", &f1, &f2 ) == 2 ) f1 = us_strtod( s, &psz_temp );
if( *psz_temp )
{ {
f2 = us_strtod( psz_temp, NULL );
mpsub_total += f1 * mpsub_factor; mpsub_total += f1 * mpsub_factor;
p_subtitle->i_start = (int64_t)(10000.0 * mpsub_total); p_subtitle->i_start = (int64_t)(10000.0 * mpsub_total);
mpsub_total += f2 * mpsub_factor; mpsub_total += f2 * mpsub_factor;
......
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