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

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


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

mkv: Fix potential divide by zero

https://hackerone.com/reports/491570

(cherry picked from commit 040038da98fc92feb153b126acfefcf245567c88)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=91f3b49532e66bd843392e1afd26b09a09594b7b
---

 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 9ce884154a..d5db3e2411 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -190,6 +190,8 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, m
         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