mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-14 03:11:25 +00:00
avformat/genh: Check block_align for how it will be used in SDX2_DPCM
Fixes: signed integer overflow: 19922944 * 1024 cannot be represented in type 'int'
Fixes: 26402/clusterfuzz-testcase-minimized-ffmpeg_dem_VMD_fuzzer-5745470053548032
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 c95b47e18f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
92d7a08c61
commit
22f451a0a3
1 changed files with 3 additions and 1 deletions
|
|
@ -87,7 +87,9 @@ static int genh_read_header(AVFormatContext *s)
|
|||
case 5: st->codecpar->codec_id = st->codecpar->block_align > 0 ?
|
||||
AV_CODEC_ID_PCM_S8_PLANAR :
|
||||
AV_CODEC_ID_PCM_S8; break;
|
||||
case 6: st->codecpar->codec_id = AV_CODEC_ID_SDX2_DPCM; break;
|
||||
case 6: if (st->codecpar->block_align > INT_MAX/1024)
|
||||
return AVERROR_INVALIDDATA;
|
||||
st->codecpar->codec_id = AV_CODEC_ID_SDX2_DPCM; break;
|
||||
case 7: ret = ff_alloc_extradata(st->codecpar, 2);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue