From 16e0416fa47ca391214ad20d162240e5d492bf0e Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 1 Jul 2013 22:04:48 +0000 Subject: [PATCH] idcin: check return value of av_malloc() Signed-off-by: Paul B Mahol --- libavformat/idcin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/idcin.c b/libavformat/idcin.c index 31d34f38fc..85d538c4f3 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -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;