avcodec/asfdec: check return value of av_mallocz()
authorPaul B Mahol <onemda@gmail.com>
Mon, 9 Sep 2013 12:09:31 +0000 (12:09 +0000)
committerPaul B Mahol <onemda@gmail.com>
Mon, 9 Sep 2013 12:09:31 +0000 (12:09 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/asfdec.c

index 0d6370d..9f49c12 100644 (file)
@@ -465,6 +465,8 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
             st->codec->extradata_size = ffio_limit(pb, sizeX - 40);
             st->codec->extradata      = av_mallocz(st->codec->extradata_size +
                                                    FF_INPUT_BUFFER_PADDING_SIZE);
+            if (!st->codec->extradata)
+                return AVERROR(ENOMEM);
             avio_read(pb, st->codec->extradata, st->codec->extradata_size);
         }