aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2013-12-29 10:52:19 +0100
committerNicolas George <george@nsup.org>2013-12-30 10:58:02 +0100
commit19a2d101acc0260bb310e79010a8491b10716189 (patch)
tree7a4aafa4c50a56c4a9be4249c5c190bd04f8b087 /libavcodec
parent97af2faaba70c866ae4c11459a79a16d4a014530 (diff)
downloadffmpeg-19a2d101acc0260bb310e79010a8491b10716189.tar.gz
lavc/mjpegenc: check av_frame_alloc() failure.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpegenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index f23343af84..7837ce975e 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -548,6 +548,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++) {