diff options
author | Peter Belkner <pbelkner@snafu.de> | 2011-04-19 11:58:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-19 13:25:05 +0200 |
commit | 22fa406f384eb9d825b1d691332e1f928750d55b (patch) | |
tree | 26ce3bf86a78df059a1817c07b58d5d085f7e252 /libavcodec | |
parent | c438c9075655951a8de2c41af1f76574cf22ab85 (diff) | |
download | ffmpeg-22fa406f384eb9d825b1d691332e1f928750d55b.tar.gz |
Check avcodec_alloc_frame() failure.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libmp3lame.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index db0bc8259c..086c7dc7f9 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -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; |