Commit 17291ac5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Detect division by zero before it happens

Pointed-out-by: Drew Yao
Signed-off-by: default avatarRémi Denis-Courmont <rem@videolan.org>
parent 783ab03c
......@@ -1127,6 +1127,8 @@ static int ReadCodecSpecificData( demux_t *p_demux, int i_len, int i_num )
i_subpacket_h = GetWBE( p_peek ); p_peek += 2; /* 1 */
i_frame_size = GetWBE( p_peek ); p_peek += 2; /* frame size */
i_subpacket_size = GetWBE( p_peek ); p_peek += 2; /* subpacket_size */
if( !i_subpacket_size || !i_frame_size || !i_coded_frame_size )
return VLC_EGENERIC;
p_peek += 2; /* ?? */
if( i_version == 5 ) p_peek += 6; /* 0, srate, 0 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment