summaryrefslogtreecommitdiff
path: root/libavcodec/libmp3lame.c
diff options
context:
space:
mode:
authorPeter Belkner <pbelkner@snafu.de>2011-04-19 11:58:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-19 13:25:05 +0200
commit22fa406f384eb9d825b1d691332e1f928750d55b (patch)
tree26ce3bf86a78df059a1817c07b58d5d085f7e252 /libavcodec/libmp3lame.c
parentc438c9075655951a8de2c41af1f76574cf22ab85 (diff)
Check avcodec_alloc_frame() failure.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libmp3lame.c')
-rw-r--r--libavcodec/libmp3lame.c6
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;