summaryrefslogtreecommitdiff
path: root/libavcodec/pcm.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-02-15 19:26:09 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-02-25 11:49:41 -0500
commita8bdf2405c6027f45a899eaaa6ba74e97c1c2701 (patch)
tree0538bf58d2aca6d32b0dc45f5b2806b330b9898a /libavcodec/pcm.c
parent255ad8881db0fa937e3632c4937f23d29d0e423d (diff)
check for coded_frame allocation failure in several audio encoders
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r--libavcodec/pcm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 2e0b5ec4b0..d0407453de 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -49,6 +49,8 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx)
avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
avctx->coded_frame= avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
return 0;
}