mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avcodec/aacpsy: Check bandwidth
Fixes: Ticket8011 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c520b98691
commit
36dead4bc2
@ -308,6 +308,9 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
|
|||||||
const int bandwidth = ctx->cutoff ? ctx->cutoff : AAC_CUTOFF(ctx->avctx);
|
const int bandwidth = ctx->cutoff ? ctx->cutoff : AAC_CUTOFF(ctx->avctx);
|
||||||
const float num_bark = calc_bark((float)bandwidth);
|
const float num_bark = calc_bark((float)bandwidth);
|
||||||
|
|
||||||
|
if (bandwidth <= 0)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext));
|
ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext));
|
||||||
if (!ctx->model_priv_data)
|
if (!ctx->model_priv_data)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Loading…
Reference in New Issue
Block a user