[FFmpeg-cvslog] mpjpeg: Check stream allocation

Luca Barbato git at videolan.org
Sun Jun 28 14:06:09 CEST 2015


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sat Jun 27 23:19:36 2015 +0200| [8a26ae5f94e613dbf7eb8e3c60462e966e409cdc] | committer: Luca Barbato

mpjpeg: Check stream allocation

Bug-Id: CID 1308152

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

 libavformat/mpjpegdec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index e2a2ece..fda4c38 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -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;



More information about the ffmpeg-cvslog mailing list