[vlc-devel] commit: TTA: potential 0 divider ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Aug 20 22:04:19 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Aug 20 23:06:32 2008 +0300| [f789b29e0730f8c8e288517d1bd7956a8cfbb214] | committer: Rémi Denis-Courmont 

TTA: potential 0 divider

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

 modules/demux/tta.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/demux/tta.c b/modules/demux/tta.c
index 42fda08..ea5e768 100644
--- a/modules/demux/tta.c
+++ b/modules/demux/tta.c
@@ -118,6 +118,11 @@ static int Open( vlc_object_t * p_this )
     fmt.audio.i_channels = GetWLE( &p_header[6] );
     fmt.audio.i_bitspersample = GetWLE( &p_header[8] );
     fmt.audio.i_rate = GetDWLE( &p_header[10] );
+    if( fmt.audio.i_rate == 0 )
+    {
+        free( p_sys );
+        return VLC_EGENERIC;
+    }
 
     p_sys->i_datalength = GetDWLE( &p_header[14] );
     p_sys->i_framelength = TTA_FRAMETIME * fmt.audio.i_rate;




More information about the vlc-devel mailing list