[FFmpeg-cvslog] idcin: check return value of av_malloc()

Paul B Mahol git at videolan.org
Tue Jul 2 00:06:53 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Jul  1 22:04:48 2013 +0000| [16e0416fa47ca391214ad20d162240e5d492bf0e] | committer: Paul B Mahol

idcin: check return value of av_malloc()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=16e0416fa47ca391214ad20d162240e5d492bf0e
---

 libavformat/idcin.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index 31d34f3..85d538c 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;



More information about the ffmpeg-cvslog mailing list