[FFmpeg-cvslog] avformat/dsfdec: Change order of operations in bitrate computation
Michael Niedermayer
git at videolan.org
Wed Sep 8 22:43:38 EEST 2021
ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Fri Apr 23 19:39:16 2021 +0200| [70fa5522c76d0564f1fad7a9e2bbd83587529af0] | committer: Michael Niedermayer
avformat/dsfdec: Change order of operations in bitrate computation
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 <michael at niedermayer.cc>
(cherry picked from commit 5e38eff284637e9f7c3c25d020df549ca6667e40)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70fa5522c76d0564f1fad7a9e2bbd83587529af0
---
libavformat/dsfdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/dsfdec.c b/libavformat/dsfdec.c
index 1df163e114..71dbf2f112 100644
--- a/libavformat/dsfdec.c
+++ b/libavformat/dsfdec.c
@@ -129,7 +129,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);
More information about the ffmpeg-cvslog
mailing list