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:
parent
c438c90756
commit
22fa406f38
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user