summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacpsy.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-01 01:32:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-01 01:32:12 +0200
commit63fdedc79470de309693d7ce7fe75cfcf0a268d8 (patch)
treeb98a884e41547fc8bd94091dbf8b1f849094e913 /libavcodec/aacpsy.c
parent0f69f02eb746124536a81effe9000a4dc876c7d8 (diff)
parent074a1b37325bf6d1483fc23ebf1255e78d998339 (diff)
downloadffmpeg-streaming-63fdedc79470de309693d7ce7fe75cfcf0a268d8.zip
ffmpeg-streaming-63fdedc79470de309693d7ce7fe75cfcf0a268d8.tar.gz
Merge commit '074a1b37325bf6d1483fc23ebf1255e78d998339'
* commit '074a1b37325bf6d1483fc23ebf1255e78d998339': aacpsy: Check memory allocation Conflicts: libavcodec/aacpsy.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r--libavcodec/aacpsy.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index 49ff3fe..0d05937 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -304,6 +304,8 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
const float num_bark = calc_bark((float)bandwidth);
ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext));
+ if (!ctx->model_priv_data)
+ return AVERROR(ENOMEM);
pctx = (AacPsyContext*) ctx->model_priv_data;
pctx->chan_bitrate = chan_bitrate;
@@ -355,6 +357,10 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
}
pctx->ch = av_mallocz_array(ctx->avctx->channels, sizeof(AacPsyChannel));
+ if (!pctx->ch) {
+ av_freep(&pctx);
+ return AVERROR(ENOMEM);
+ }
lame_window_init(pctx, ctx->avctx);
OpenPOWER on IntegriCloud