aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/aacpsy.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-29 17:50:27 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-06-02 17:30:24 +0200
commit36dead4bc28ca8aab13c61661f28c68bdefa5e9d (patch)
tree581c39b0ba2a53bac6d68c904bb173749190b192 /libavcodec/aacpsy.c
parentc520b986915a3fdf3a20f6ce0ad5833eccfb7a91 (diff)
downloadffmpeg-36dead4bc28ca8aab13c61661f28c68bdefa5e9d.tar.gz
avcodec/aacpsy: Check bandwidth
Fixes: Ticket8011 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r--libavcodec/aacpsy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index e51d29750b..487b84fd85 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);