summaryrefslogtreecommitdiff
path: root/libavcodec/libopenjpegenc.c
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2013-12-29 10:50:24 +0100
committerNicolas George <george@nsup.org>2013-12-30 10:58:02 +0100
commit97af2faaba70c866ae4c11459a79a16d4a014530 (patch)
tree637b29470d77490cbf60e474d697320299fcf993 /libavcodec/libopenjpegenc.c
parenta91394f4de63ae5c2e21c548045b79393ca7fea1 (diff)
downloadffmpeg-97af2faaba70c866ae4c11459a79a16d4a014530.tar.gz
lavc/libopenjpegenc: check av_frame_alloc() failure.
Diffstat (limited to 'libavcodec/libopenjpegenc.c')
-rw-r--r--libavcodec/libopenjpegenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 0205c7df81..e056dd7b95 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];