[vlc-commits] demux: subtitle: int overflows (cid #1253093, #1253086)
Francois Cartegnie
git at videolan.org
Wed Jan 25 10:56:00 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 25 10:24:05 2017 +0100| [c6469748565964ce68c8db04f7d94651204eb735] | committer: Francois Cartegnie
demux: subtitle: int overflows (cid #1253093, #1253086)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c6469748565964ce68c8db04f7d94651204eb735
---
modules/demux/subtitle.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 6f630b1..4cb4dc9 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -1724,10 +1724,10 @@ static int ParseJSS( vlc_object_t *p_obj, subs_properties_t *p_props,
if( sscanf( s, "%d:%d:%d.%d %d:%d:%d.%d %[^\n\r]",
&h1, &m1, &s1, &f1, &h2, &m2, &s2, &f2, psz_text ) == 9 )
{
- p_subtitle->i_start = ( (int64_t)( h1 *3600 + m1 * 60 + s1 ) +
+ p_subtitle->i_start = ( ( (int64_t) h1 *3600 + m1 * 60 + s1 ) +
(int64_t)( ( f1 + p_props->jss.i_time_shift ) / p_props->jss.i_time_resolution ) )
* 1000000;
- p_subtitle->i_stop = ( (int64_t)( h2 *3600 + m2 * 60 + s2 ) +
+ p_subtitle->i_stop = ( ( (int64_t) h2 *3600 + m2 * 60 + s2 ) +
(int64_t)( ( f2 + p_props->jss.i_time_shift ) / p_props->jss.i_time_resolution ) )
* 1000000;
break;
@@ -1735,9 +1735,9 @@ static int ParseJSS( vlc_object_t *p_obj, subs_properties_t *p_props,
/* Short time lines */
else if( sscanf( s, "@%d @%d %[^\n\r]", &f1, &f2, psz_text ) == 3 )
{
- p_subtitle->i_start = (int64_t)(
+ p_subtitle->i_start = ((int64_t)
( f1 + p_props->jss.i_time_shift ) / p_props->jss.i_time_resolution * 1000000.0 );
- p_subtitle->i_stop = (int64_t)(
+ p_subtitle->i_stop = ((int64_t)
( f2 + p_props->jss.i_time_shift ) / p_props->jss.i_time_resolution * 1000000.0 );
break;
}
More information about the vlc-commits
mailing list