lavc/mjpegenc: check av_frame_alloc() failure.
authorNicolas George <george@nsup.org>
Sun, 29 Dec 2013 09:52:19 +0000 (10:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 7 Jan 2014 20:28:41 +0000 (21:28 +0100)
(cherry picked from commit 19a2d101acc0260bb310e79010a8491b10716189)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegenc.c

index fcac6f1..8963289 100644 (file)
@@ -506,6 +506,8 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
         return -1;
 
     pic = av_frame_alloc();
+    if (!pic)
+        return AVERROR(ENOMEM);
     av_frame_ref(pic, pic_arg);
     //picture should be flipped upside-down
     for(i=0; i < 3; i++) {