summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2021-03-03 10:49:03 +0100
committerMichael Niedermayer <[email protected]>2021-10-06 14:41:40 +0200
commite9f3c3359160d0cd55f622c761733e0db796535f (patch)
tree23e58de333d4455d329a05117f3374cec30ce451
parent99e2e63ae287b2f8477de3fd6a032b1503ceba21 (diff)
avformat/dcstr: Check sample rate
Fixes: signed integer overflow: -1300248894420254720 * 16 cannot be represented in type 'long' Fixes: 30879/clusterfuzz-testcase-minimized-ffmpeg_dem_DCSTR_fuzzer-5094464215449600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit fdcb966f4a3c6f872891b8dd554e3652b9e02d4f) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/dcstr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/dcstr.c b/libavformat/dcstr.c
index 9041a86539..9ddccc7f2d 100644
--- a/libavformat/dcstr.c
+++ b/libavformat/dcstr.c
@@ -43,6 +43,8 @@ static int dcstr_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->channels = avio_rl32(s->pb);
st->codecpar->sample_rate = avio_rl32(s->pb);
+ if (st->codecpar->sample_rate <= 0)
+ return AVERROR_INVALIDDATA;
codec = avio_rl32(s->pb);
align = avio_rl32(s->pb);
avio_skip(s->pb, 4);