idcin: check return value of av_malloc()
authorPaul B Mahol <onemda@gmail.com>
Mon, 1 Jul 2013 22:04:48 +0000 (22:04 +0000)
committerPaul B Mahol <onemda@gmail.com>
Mon, 1 Jul 2013 22:04:48 +0000 (22:04 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/idcin.c

index 31d34f38fc3adfd35336d12f9d9f572e63b7db26..85d538c4f372fbe9951010884485664e19528dfc 100644 (file)
@@ -196,8 +196,10 @@ static int idcin_read_header(AVFormatContext *s)
     st->codec->height = height;
 
     /* load up the Huffman tables into extradata */
-    st->codec->extradata_size = HUFFMAN_TABLE_SIZE;
     st->codec->extradata = av_malloc(HUFFMAN_TABLE_SIZE);
+    if (!st->codec->extradata)
+        return AVERROR(ENOMEM);
+    st->codec->extradata_size = HUFFMAN_TABLE_SIZE;
     ret = avio_read(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE);
     if (ret < 0) {
         return ret;