OSDN Git Service

mpjpeg: Check stream allocation
authorLuca Barbato <lu_zero@gentoo.org>
Sat, 27 Jun 2015 21:19:36 +0000 (23:19 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 28 Jun 2015 08:27:19 +0000 (10:27 +0200)
Bug-Id: CID 1308152

libavformat/mpjpegdec.c

index e2a2ece..fda4c38 100644 (file)
@@ -123,6 +123,8 @@ static int mpjpeg_read_header(AVFormatContext *s)
         return AVERROR_INVALIDDATA;
 
     st = avformat_new_stream(s, NULL);
+    if (!st)
+        return AVERROR(ENOMEM);
 
     st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     st->codec->codec_id   = AV_CODEC_ID_MJPEG;