1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Check avcodec_alloc_frame() failure.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Peter Belkner 2011-04-19 11:58:53 +02:00 committed by Michael Niedermayer
parent c438c90756
commit 22fa406f38

View File

@ -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;