Commit 074a1b37 authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Luca Barbato

aacpsy: Check memory allocation

parent 149fa0b7
......@@ -298,6 +298,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;
......@@ -349,6 +351,10 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
}
pctx->ch = av_mallocz(sizeof(AacPsyChannel) * ctx->avctx->channels);
if (!pctx->ch) {
av_freep(&pctx);
return AVERROR(ENOMEM);
}
lame_window_init(pctx, ctx->avctx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment