[vlc-commits] xa: fix divisions by zero

Rémi Denis-Courmont git at videolan.org
Fri Oct 28 16:13:10 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Oct 28 17:11:55 2016 +0300| [bc835c8fcac52e7e9d9d371324abbee95bca59a0] | committer: Rémi Denis-Courmont

xa: fix divisions by zero

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

 modules/demux/xa.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/demux/xa.c b/modules/demux/xa.c
index d898936..7f9d260 100644
--- a/modules/demux/xa.c
+++ b/modules/demux/xa.c
@@ -142,6 +142,12 @@ static int Open( vlc_object_t * p_this )
              (char *)&fmt.i_codec, fmt.audio.i_channels, fmt.audio.i_rate,
              fmt.i_bitrate / 8192, fmt.audio.i_blockalign );
 
+    if( fmt.audio.i_rate == 0 || fmt.audio.i_channels == 0 )
+    {
+        free( p_sys );
+        return VLC_EGENERIC;
+    }
+
     p_sys->p_es = es_out_Add( p_demux->out, &fmt );
 
     date_Init( &p_sys->pts, fmt.audio.i_rate, 1 );



More information about the vlc-commits mailing list