[FFmpeg-cvslog] avformat/3dostr: Check sample_rate
Michael Niedermayer
git at videolan.org
Sat Feb 20 22:10:28 EET 2021
ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb 8 14:29:02 2021 +0100| [81735671c27c9d1aa9afc22f8faa582176ef4869] | committer: Michael Niedermayer
avformat/3dostr: Check sample_rate
Fixes: signed integer overflow: -1268324762623155200 * 8 cannot be represented in type 'long'
Fixes: 30123/clusterfuzz-testcase-minimized-ffmpeg_dem_THREEDOSTR_fuzzer-6710765123928064
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 7e5034f97e41d3f8112c1f8da3b5274ab99ef6f8)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81735671c27c9d1aa9afc22f8faa582176ef4869
---
libavformat/3dostr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/3dostr.c b/libavformat/3dostr.c
index 6c49f7589c..e77df9e5c9 100644
--- a/libavformat/3dostr.c
+++ b/libavformat/3dostr.c
@@ -64,7 +64,7 @@ static int threedostr_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->sample_rate = avio_rb32(s->pb);
st->codecpar->channels = avio_rb32(s->pb);
- if (st->codecpar->channels <= 0)
+ if (st->codecpar->channels <= 0 || st->codecpar->sample_rate <= 0)
return AVERROR_INVALIDDATA;
codec = avio_rl32(s->pb);
avio_skip(s->pb, 4);
More information about the ffmpeg-cvslog
mailing list