avformat/smacker: check avformat_new_stream() return value
authorPaul B Mahol <onemda@gmail.com>
Wed, 11 Sep 2013 10:23:03 +0000 (10:23 +0000)
committerPaul B Mahol <onemda@gmail.com>
Wed, 11 Sep 2013 11:12:35 +0000 (11:12 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/smacker.c

index b4c1bf4..b0ccd53 100644 (file)
@@ -180,6 +180,8 @@ static int smacker_read_header(AVFormatContext *s)
         smk->indexes[i] = -1;
         if (smk->rates[i]) {
             ast[i] = avformat_new_stream(s, NULL);
+            if (!ast[i])
+                return AVERROR(ENOMEM);
             smk->indexes[i] = ast[i]->index;
             ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
             if (smk->aflags[i] & SMK_AUD_BINKAUD) {