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

Nicolas George git at videolan.org
Mon Dec 30 13:37:38 CET 2013


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Sun Dec 29 10:50:24 2013 +0100| [97af2faaba70c866ae4c11459a79a16d4a014530] | committer: Nicolas George

lavc/libopenjpegenc: check av_frame_alloc() failure.

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

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

diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 0205c7d..e056dd7 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -502,6 +502,8 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     case AV_PIX_FMT_GBRP14:
     case AV_PIX_FMT_GBRP16:
         gbrframe = av_frame_alloc();
+        if (!gbrframe)
+            return AVERROR(ENOMEM);
         av_frame_ref(gbrframe, frame);
         gbrframe->data[0] = frame->data[2]; // swap to be rgb
         gbrframe->data[1] = frame->data[0];



More information about the ffmpeg-cvslog mailing list