From a8bdf2405c6027f45a899eaaa6ba74e97c1c2701 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Wed, 15 Feb 2012 19:26:09 -0500 Subject: check for coded_frame allocation failure in several audio encoders --- libavcodec/libopencore-amr.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/libopencore-amr.c') diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index ded92179d3..ebbc0d90d7 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -196,10 +196,13 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx) avctx->frame_size = 160; avctx->coded_frame = avcodec_alloc_frame(); + if (!avctx->coded_frame) + return AVERROR(ENOMEM); s->enc_state = Encoder_Interface_init(s->enc_dtx); if (!s->enc_state) { av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n"); + av_freep(&avctx->coded_frame); return -1; } -- cgit v1.2.3