[vlc-commits] VorbisChapter: prevent overflow

Jean-Baptiste Kempf git at videolan.org
Sat Sep 7 22:36:21 CEST 2013


vlc/vlc-2.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep  7 22:34:09 2013 +0200| [0d36059e14ae127ab72470c56a9c970f4b03a0d5] | committer: Jean-Baptiste Kempf

VorbisChapter: prevent overflow

(cherry picked from commit 0f93aae701dc25657e206d9d776c5f949d142acb)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=0d36059e14ae127ab72470c56a9c970f4b03a0d5
---

 modules/demux/xiph_metadata.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/xiph_metadata.c b/modules/demux/xiph_metadata.c
index f4f324d..8a4fb91 100644
--- a/modules/demux/xiph_metadata.c
+++ b/modules/demux/xiph_metadata.c
@@ -262,7 +262,7 @@ void vorbis_ParseComment( vlc_meta_t **pp_meta,
                 if( sscanf( p, "%d:%d:%d.%d", &h, &m, &s, &ms ) == 4 )
                 {
                     sk = vlc_seekpoint_New();
-                    sk->i_time_offset = ((h * 3600 + m * 60 + s) *1000 + ms) * 1000;
+                    sk->i_time_offset = (((int64_t)h * 3600 + (int64_t)m * 60 + (int64_t)s) * 1000 + ms) * 1000;
                     TAB_APPEND_CAST( (seekpoint_t**), *i_seekpoint, *ppp_seekpoint, sk );
                 }
             }



More information about the vlc-commits mailing list