vc1test: Check malloc call
authorNidhi Makhijani <nidhimj22@gmail.com>
Sun, 6 Jul 2014 15:22:52 +0000 (20:52 +0530)
committerDiego Biurrun <diego@biurrun.de>
Sun, 6 Jul 2014 16:25:52 +0000 (09:25 -0700)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavformat/vc1test.c

index 8fabf7de9b776f9cad22c5106a0e69174d196aeb..f302c2b12af8b50eb49fc1677c10ee0b63a059f8 100644 (file)
@@ -62,6 +62,8 @@ static int vc1t_read_header(AVFormatContext *s)
     st->codec->codec_id = AV_CODEC_ID_WMV3;
 
     st->codec->extradata = av_malloc(VC1_EXTRADATA_SIZE);
+    if (!st->codec->extradata)
+        return AVERROR(ENOMEM);
     st->codec->extradata_size = VC1_EXTRADATA_SIZE;
     avio_read(pb, st->codec->extradata, VC1_EXTRADATA_SIZE);
     st->codec->height = avio_rl32(pb);