faad: Fix read buffer overflow
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>
Tue, 30 Jul 2019 12:07:34 +0000 (14:07 +0200)
committerHugo Beauzée-Luyssen <hugo@beauzee.fr>
Wed, 14 Aug 2019 12:03:49 +0000 (14:03 +0200)
modules/codec/faad.c

index 0bb2b52..021aa86 100644 (file)
@@ -140,7 +140,8 @@ static int Open( vlc_object_t *p_this )
 
         if( NeAACDecInit2( p_sys->hfaad, p_dec->fmt_in.p_extra,
                            p_dec->fmt_in.i_extra,
-                           &i_rate, &i_channels ) < 0 )
+                           &i_rate, &i_channels ) < 0 ||
+                i_channels >= MPEG4_ASC_MAX_INDEXEDPOS )
         {
             msg_Err( p_dec, "Failed to initialize faad using extra data" );
             NeAACDecClose( p_sys->hfaad );