From 4becd4e3150bcd553c86be67e6522c27184073a0 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 24 Nov 2012 00:51:48 +0100 Subject: [PATCH] Make sure avcodec_alloc_frame() returns valid. --- record/ffemu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/record/ffemu.c b/record/ffemu.c index 44cda93405..86650430ba 100644 --- a/record/ffemu.c +++ b/record/ffemu.c @@ -764,6 +764,8 @@ static bool encode_audio(ffemu_t *handle, AVPacket *pkt, bool dry) #ifdef HAVE_FFMPEG_AVCODEC_ENCODE_AUDIO2 AVFrame *frame = avcodec_alloc_frame(); + if (!frame) + return false; frame->nb_samples = handle->audio.frames_in_buffer; frame->pts = handle->audio.frame_cnt;