Skip to content

Commit

Permalink
avformat/dsfdec: Change order of operations in bitrate computation
Browse files Browse the repository at this point in the history
Fixes: signed integer overflow: 538976288 * 67372036 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_DSF_fuzzer-6751696819716096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Jul 31, 2021
1 parent b4e77df commit 5e38eff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavformat/dsfdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static int dsf_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
st->codecpar->block_align *= st->codecpar->channels;
st->codecpar->bit_rate = st->codecpar->channels * st->codecpar->sample_rate * 8LL;
st->codecpar->bit_rate = st->codecpar->channels * 8LL * st->codecpar->sample_rate;
avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
avio_skip(pb, 4);

Expand Down

0 comments on commit 5e38eff

Please sign in to comment.