aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-29 17:50:27 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-06-18 20:53:56 +0200
commit159403fc9f2d80e822b9728040b57dfc3271c1df (patch)
treeb9c0d8fe7e61a7a56e469c89c03077f26f816288
parent27727d56bfee30b3a9e74e8c9a7a498823c17cfe (diff)
downloadffmpeg-159403fc9f2d80e822b9728040b57dfc3271c1df.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.c3
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);