avformat/sbgdec: Check alloc_array_elem() return value

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-06-02 14:58:20 +02:00
parent fccde16afa
commit ce4e57dbb5

View File

@ -973,6 +973,8 @@ static int expand_tseq(void *log, struct sbg_script *s, int *nb_ev_max,
} else { } else {
ev = alloc_array_elem((void **)&s->events, sizeof(*ev), ev = alloc_array_elem((void **)&s->events, sizeof(*ev),
&s->nb_events, nb_ev_max); &s->nb_events, nb_ev_max);
if (!ev)
return AVERROR(ENOMEM);
ev->ts = tseq->ts.t; ev->ts = tseq->ts.t;
ev->elements = def->elements; ev->elements = def->elements;
ev->nb_elements = def->nb_elements; ev->nb_elements = def->nb_elements;