[vlc-commits] mkv: Fix potential buffer overflow
Hugo Beauzée-Luyssen
git at videolan.org
Thu May 23 17:40:38 CEST 2019
vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri May 3 22:42:34 2019 +0200| [cdc401914e800f708e4a1a7d76c781180999d6fd] | committer: Hugo Beauzée-Luyssen
mkv: Fix potential buffer overflow
https://hackerone.com/reports/503218
(cherry picked from commit af75fb6f24d74e51dbddeca5c6692404e7b25307)
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=cdc401914e800f708e4a1a7d76c781180999d6fd
---
modules/demux/mkv/matroska_segment_parse.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 34864ae310..9a951211b3 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1710,6 +1710,8 @@ bool matroska_segment_c::TrackInit( mkv_track_t * p_tk )
p_tk->fmt.audio.i_bitspersample = GetWLE( &p_wf->wBitsPerSample );
p_tk->fmt.i_extra = GetWLE( &p_wf->cbSize );
+ if ( (size_t)p_tk->fmt.i_extra > p_tk->i_extra_data - sizeof( WAVEFORMATEX ) )
+ p_tk->fmt.i_extra = 0;
if( p_tk->fmt.i_extra != 0 )
{
p_tk->fmt.p_extra = xmalloc( p_tk->fmt.i_extra );
More information about the vlc-commits
mailing list