mvi: check av_mallocz() result
authorPaul B Mahol <onemda@gmail.com>
Sat, 1 Dec 2012 09:03:24 +0000 (09:03 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sat, 1 Dec 2012 09:06:24 +0000 (09:06 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/mvi.c

index 6ab95b9..9184927 100644 (file)
@@ -54,6 +54,8 @@ static int read_header(AVFormatContext *s)
 
     vst->codec->extradata_size = 2;
     vst->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE);
+    if (!vst->codec->extradata)
+        return AVERROR(ENOMEM);
 
     version                  = avio_r8(pb);
     vst->codec->extradata[0] = avio_r8(pb);