Commit d2c3e277 authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Derk-Jan Hartman

Avoid a malloc(0)

(cherry picked from commit 4fa0611d)
parent 519dcbcc
......@@ -1688,9 +1688,12 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
if( p_avcC )
{
p_track->fmt.i_extra = p_avcC->data.p_avcC->i_avcC;
p_track->fmt.p_extra = malloc( p_avcC->data.p_avcC->i_avcC );
memcpy( p_track->fmt.p_extra, p_avcC->data.p_avcC->p_avcC,
p_track->fmt.i_extra );
if( p_track->fmt.i_extra > 0 )
{
p_track->fmt.p_extra = malloc( p_avcC->data.p_avcC->i_avcC );
memcpy( p_track->fmt.p_extra, p_avcC->data.p_avcC->p_avcC,
p_track->fmt.i_extra );
}
}
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment