[FFmpeg-cvslog] lavc/mjpegenc: check av_frame_alloc() failure.

Nicolas George git at videolan.org
Tue Jan 7 21:35:33 CET 2014


ffmpeg | branch: release/2.1 | Nicolas George <george at nsup.org> | Sun Dec 29 10:52:19 2013 +0100| [9189a0a71ba4bcdb4d5ddbe9561aeda18ecee594] | committer: Michael Niedermayer

lavc/mjpegenc: check av_frame_alloc() failure.
(cherry picked from commit 19a2d101acc0260bb310e79010a8491b10716189)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/mjpegenc.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index fcac6f1..8963289 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -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++) {



More information about the ffmpeg-cvslog mailing list