[vlc-devel] [PATCH] demux: mp4: fix crashes with VPx

Francois Cartegnie fcvlcdev at free.fr
Thu Sep 22 13:25:17 CEST 2016


Le 22/09/2016 à 13:17, Tristan Matthews a écrit :
> Reported by Vittorio Giovara.
> ---
>  modules/demux/mp4/essetup.c | 1 +
>  modules/demux/mp4/libmp4.c  | 4 ++++
>  2 files changed, 5 insertions(+)

Forgot to alloc in 2 different places. Surprising.
At least cannot crash with VP8.

> diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
> index 446bf84..f299fd1 100644
> --- a/modules/demux/mp4/essetup.c
> +++ b/modules/demux/mp4/essetup.c
> @@ -601,6 +601,7 @@ int SetupVideoES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
>                  p_track->fmt.video.i_bits_per_pixel = p_data->i_bit_depth;
>  
>                  p_track->fmt.i_extra = p_data->i_codec_init_datasize;
> +                p_track->fmt.p_extra = malloc( p_track->fmt.i_extra );
>                  memcpy( p_track->fmt.p_extra, p_data->p_codec_init_data, p_data->i_codec_init_datasize );

Need checked alloc then.

Francois



More information about the vlc-devel mailing list