[vlc-commits] demux: mkv: fix warning & int overflow

Francois Cartegnie git at videolan.org
Fri Apr 4 08:53:54 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Apr  4 08:50:12 2014 +0200| [6dff8ffd6c4457e6619a004b23284f5a06a76882] | committer: Francois Cartegnie

demux: mkv: fix warning & int overflow

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6dff8ffd6c4457e6619a004b23284f5a06a76882
---

 modules/demux/mkv/util.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mkv/util.cpp b/modules/demux/mkv/util.cpp
index 326f631..9608b95 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -188,12 +188,12 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, m
     if( p_tk->fmt.i_codec == VLC_CODEC_COOK ||
         p_tk->fmt.i_codec == VLC_CODEC_ATRAC3 )
     {
-        const uint32_t i_num = p_sys->i_frame_size / p_sys->i_subpacket_size;
-        const int y = p_sys->i_subpacket / ( p_sys->i_frame_size / p_sys->i_subpacket_size );
+        const uint16_t i_num = p_sys->i_frame_size / p_sys->i_subpacket_size;
+        const size_t y = p_sys->i_subpacket / ( p_sys->i_frame_size / p_sys->i_subpacket_size );
 
-        for( int i = 0; i < i_num; i++ )
+        for( uint16_t i = 0; i < i_num; i++ )
         {
-            int i_index = p_sys->i_sub_packet_h * i +
+            size_t i_index = (size_t) p_sys->i_sub_packet_h * i +
                           ((p_sys->i_sub_packet_h + 1) / 2) * (y&1) + (y>>1);
             if( i_index >= p_sys->i_subpackets )
                 return;



More information about the vlc-commits mailing list