[vlc-devel] [vlc-commits] codec: faad: fail if no extradata

Rafaël Carré funman at videolan.org
Fri Jun 6 20:18:14 CEST 2014


On 06/06/14 10:42, Francois Cartegnie wrote:
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jun  6 19:40:25 2014 +0200| [ccc273b48cef823e1536d80904c1e080cac4f1aa] | committer: Francois Cartegnie
> 
> codec: faad: fail if no extradata
> 
> both packetizer and codec requiring extra
> 
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ccc273b48cef823e1536d80904c1e080cac4f1aa
> ---
> 
>  modules/codec/faad.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/modules/codec/faad.c b/modules/codec/faad.c
> index 9aaaed6..aaf978a 100644
> --- a/modules/codec/faad.c
> +++ b/modules/codec/faad.c
> @@ -130,6 +130,12 @@ static int Open( vlc_object_t *p_this )
>          return VLC_EGENERIC;
>      }
>  
> +    if ( !p_dec->fmt_in.i_extra )
> +    {
> +        msg_Err( p_dec, "cannot initialize faad wihtout codec extradata" );
> +        return VLC_EGENERIC;
> +    }
> +
>      /* Allocate the memory needed to store the decoder's structure */
>      if( ( p_dec->p_sys = p_sys = malloc( sizeof(*p_sys) ) ) == NULL )
>          return VLC_ENOMEM;

This conflicts with:

    if( p_dec->fmt_in.i_extra > 0 )
    {
        /* We have a decoder config so init the handle */
        [...]
    }
    else
    {
        /* Will be initalised from first frame */
        p_dec->fmt_out.audio.i_rate = 0;
        p_dec->fmt_out.audio.i_channels = 0;
    }




More information about the vlc-devel mailing list