[vlc-commits] mkv: Fix potential divide by zero

Hugo Beauzée-Luyssen git at videolan.org
Thu May 23 17:20:43 CEST 2019


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Feb  7 11:28:30 2019 +0100| [040038da98fc92feb153b126acfefcf245567c88] | committer: Hugo Beauzée-Luyssen

mkv: Fix potential divide by zero

https://hackerone.com/reports/491570

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

 modules/demux/mkv/util.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/demux/mkv/util.cpp b/modules/demux/mkv/util.cpp
index 8b2e1e76db..1b5ded064c 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -191,6 +191,8 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, v
         p_tk->fmt.i_codec == VLC_CODEC_ATRAC3 )
     {
         const uint16_t i_num = p_sys->i_frame_size / p_sys->i_subpacket_size;
+        if ( i_num == 0 )
+            return;
         const size_t y = p_sys->i_subpacket / i_num;
 
         for( uint16_t i = 0; i < i_num; i++ )



More information about the vlc-commits mailing list