lavc/mjpegenc: check av_frame_alloc() failure.

(cherry picked from commit 19a2d101ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Nicolas George
2013-12-29 10:52:19 +01:00
committed by Michael Niedermayer
parent 4b25b5a8a3
commit 9189a0a71b

View File

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