Browse Source

avformat/wavdec: Check block_align vs. channels before combining them

Fixes: signed integer overflow: 65535 * 65312 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6606935226974208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0af0a80cef)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3.2
Michael Niedermayer 5 years ago
parent
commit
9c6a0fa8f1
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavformat/wavdec.c

+ 2
- 1
libavformat/wavdec.c View File

@@ -589,7 +589,8 @@ break_loop:
} else if (st->codecpar->codec_id == AV_CODEC_ID_XMA1 ||
st->codecpar->codec_id == AV_CODEC_ID_XMA2) {
st->codecpar->block_align = 2048;
} else if (st->codecpar->codec_id == AV_CODEC_ID_ADPCM_MS && st->codecpar->channels > 2) {
} else if (st->codecpar->codec_id == AV_CODEC_ID_ADPCM_MS && st->codecpar->channels > 2 &&
st->codecpar->block_align < INT_MAX / st->codecpar->channels) {
st->codecpar->block_align *= st->codecpar->channels;
}



Loading…
Cancel
Save