[vlc-devel] [PATCH v4] Add support for GoPro HiLight tags as chapters

Francois Cartegnie fcvlcdev at free.fr
Thu Jun 2 09:44:28 CEST 2016


Le 01/06/2016 à 22:11, Emeric Grange a écrit :
>  typedef struct
>  {
> +    uint32_t i_chapter_count;
> +    uint32_t *i_chapter_start;

pi_

> +static void LoadChapterGoPro( demux_t *p_demux, MP4_Box_t *p_hmmt )
> +{
> +    demux_sys_t *p_sys = p_demux->p_sys;
> +
> +    p_sys->p_title = vlc_input_title_New();
> +    for( unsigned i = 0; i < BOXDATA(p_hmmt)->i_chapter_count; i++ )
> +    {

unchecked alloc

> +    /* Cameras are allowing a maximum of 100 tags */
> +    if( p_hmmt->i_chapter_count > 100 )
> +        p_hmmt->i_chapter_count = 100;
> +
> +    p_hmmt->i_chapter_start = calloc( p_hmmt->i_chapter_count, sizeof(uint32_t) );
> +    if( p_hmmt->i_chapter_start == NULL )
> +        MP4_READBOX_EXIT( 0 );

I believe 0 chapters is legit and should not trigger an error.

Francois


More information about the vlc-devel mailing list