Commit 694be24b authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/qdm2: error out of qdm2_fft_decode_tones() before entering endless loop

Fixes: signed integer overflow: 2147483646 + 2 cannot be represented in type 'int'
Fixes: infinite loop
Fixes: 15396/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5116605501014016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent ae021c12
......@@ -1289,6 +1289,10 @@ static void qdm2_fft_decode_tones(QDM2Context *q, int duration,
}
offset += (n - 2);
} else {
if (local_int_10 <= 2) {
av_log(NULL, AV_LOG_ERROR, "qdm2_fft_decode_tones() stuck\n");
return;
}
offset += qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2);
while (offset >= (local_int_10 - 1)) {
offset += (1 - (local_int_10 - 1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment