]> git.sesse.net Git - vlc/commitdiff
Detect division by zero before it happens
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 3 Mar 2008 17:51:52 +0000 (19:51 +0200)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 3 Mar 2008 17:51:52 +0000 (19:51 +0200)
Pointed-out-by: Drew Yao
Signed-off-by: Rémi Denis-Courmont <rem@videolan.org>
modules/demux/real.c

index f0f66aebd2a71bf498742c62aca21bae4b54ba28..a3cc2af3998984ae35b6e40896c75b1dd74f79d5 100644 (file)
@@ -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 */