diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index 0de7130f19..d4853ca200 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -196,6 +196,8 @@ 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) {