aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-18 00:48:26 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 16:04:26 +0200
commit2b3c1a30003b516cd7e406846f605716d16e6ec8 (patch)
treefe53f25917058fb35cca80ff7440ee2a2af18215
parentdcb07bee759921c83f5b009a2e11f592669ea485 (diff)
downloadffmpeg-2b3c1a30003b516cd7e406846f605716d16e6ec8.tar.gz
avformat/cafdec: clip sample rate
Fixes: 1.21126e+111 is outside the range of representable values of type 'int' Fixes: 27398/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5412960339755008 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 684aec6a6872c9e3bb0afee1979f1cd3edd1f8ce) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/cafdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 88ad99751b..6627d1eab8 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -70,7 +70,7 @@ static int read_desc_chunk(AVFormatContext *s)
/* parse format description */
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codecpar->sample_rate = av_int2double(avio_rb64(pb));
+ st->codecpar->sample_rate = av_clipd(av_int2double(avio_rb64(pb)), 0, INT_MAX);
st->codecpar->codec_tag = avio_rl32(pb);
flags = avio_rb32(pb);
caf->bytes_per_packet = avio_rb32(pb);