diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index b4b395aa8c..9366a95e30 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -267,6 +267,8 @@ static av_cold int encode_init(AVCodecContext* avc_context) /* Set up the output AVFrame */ avc_context->coded_frame = av_frame_alloc(); + if (!avc_context->coded_frame) + return AVERROR(ENOMEM); return 0; }