Commit 22fa406f authored by Peter Belkner's avatar Peter Belkner Committed by Michael Niedermayer

Check avcodec_alloc_frame() failure.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c438c907
......@@ -69,7 +69,11 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
avctx->frame_size = lame_get_framesize(s->gfp);
avctx->coded_frame= avcodec_alloc_frame();
if(!(avctx->coded_frame= avcodec_alloc_frame())) {
lame_close(s->gfp);
return AVERROR(ENOMEM);
}
avctx->coded_frame->key_frame= 1;
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment