Avoid undefined shifts

Fixes: 23522/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-5468272958111744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
This commit is contained in:
Martin Storsjo 2020-06-22 13:27:41 +03:00
parent 845febbb4a
commit ec58a940e2
1 changed files with 3 additions and 0 deletions

View File

@ -1423,6 +1423,9 @@ static INT DecodeEscapeSequence(HANDLE_FDK_BITSTREAM bs, const INT bsAnchor,
sign = (quantSpecCoef >= 0) ? 1 : -1;
if (escapeOnesCounter > 30)
escapeOnesCounter = 30;
quantSpecCoef = sign * (((INT)1 << escapeOnesCounter) + escape_word);
return quantSpecCoef;