diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-05-29 17:50:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-06 14:41:41 +0200 |
commit | e1a994fd4bb0331dbea2738c4165be2d2be53520 (patch) | |
tree | 64f59467a433a9a89bf069830ff8639d3367d968 | |
parent | 0ee20c4a1d72340c2117886bf62b3d8d3cbea6fd (diff) | |
download | ffmpeg-e1a994fd4bb0331dbea2738c4165be2d2be53520.tar.gz |
avcodec/aacpsy: Check bandwidth
Fixes: Ticket8011
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 36dead4bc28ca8aab13c61661f28c68bdefa5e9d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/aacpsy.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c index bd444fecdc..76458783ce 100644 --- a/libavcodec/aacpsy.c +++ b/libavcodec/aacpsy.c @@ -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 float num_bark = calc_bark((float)bandwidth); + if (bandwidth <= 0) + return AVERROR(EINVAL); + ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext)); if (!ctx->model_priv_data) return AVERROR(ENOMEM); |