[vlc-devel] commit: Validated the audio layout and channels compatibility in aout_DecNew. ( Laurent Aimar )

git version control git at videolan.org
Tue May 5 23:53:52 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue May  5 23:49:27 2009 +0200| [029138a07de2d76a3302f0be82c2cbc9fcae4e87] | committer: Laurent Aimar 

Validated the audio layout and channels compatibility in aout_DecNew.

It will avoid memory corruptions in case of a broken decoder.

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

 src/audio_output/dec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 0c2236b..b31b02f 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -61,6 +61,11 @@ static aout_input_t * DecNew( aout_instance_t * p_aout,
         msg_Err( p_aout, "no audio channels" );
         return NULL;
     }
+    if( p_format->i_channels != aout_FormatNbChannels( p_format ) )
+    {
+        msg_Err( p_aout, "incompatible audio channels count with layout mask" );
+        return NULL;
+    }
 
     if( p_format->i_rate > 192000 )
     {




More information about the vlc-devel mailing list