Skip to content

Commit

Permalink
Avoid undefined shifts in calculateSbrEnvelope
Browse files Browse the repository at this point in the history
Fixes: 26845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-5670674796118016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
  • Loading branch information
mstorsjo committed Nov 17, 2020
1 parent 52b6f5e commit 4b67304
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libSBRdec/src/env_calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1477,8 +1477,10 @@ void calculateSbrEnvelope(

for (k = 0; k < noSubbands; k++) {
int sc = scale_change - pNrgs->nrgGain_e[k] + (sc_change - 1);
pNrgs->nrgGain[k] >>= sc;
pNrgs->nrgGain_e[k] += sc;
if (sc > 31)
sc = 31;
pNrgs->nrgGain[k] >>= sc;
}

if (!useLP) {
Expand Down

0 comments on commit 4b67304

Please sign in to comment.