[FFmpeg-cvslog] avformat/sbgdec: Check alloc_array_elem() return value

Michael Niedermayer git at videolan.org
Tue Jun 2 18:49:59 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jun  2 14:58:20 2015 +0200| [ce4e57dbb51ac106a61fcd98330af9a619eea857] | committer: Michael Niedermayer

avformat/sbgdec: Check alloc_array_elem() return value

Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce4e57dbb51ac106a61fcd98330af9a619eea857
---

 libavformat/sbgdec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c
index 23b7ea4..03cd922 100644
--- a/libavformat/sbgdec.c
+++ b/libavformat/sbgdec.c
@@ -973,6 +973,8 @@ static int expand_tseq(void *log, struct sbg_script *s, int *nb_ev_max,
     } else {
         ev = alloc_array_elem((void **)&s->events, sizeof(*ev),
                               &s->nb_events, nb_ev_max);
+        if (!ev)
+            return AVERROR(ENOMEM);
         ev->ts          = tseq->ts.t;
         ev->elements    = def->elements;
         ev->nb_elements = def->nb_elements;



More information about the ffmpeg-cvslog mailing list