aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-19 10:53:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:53:29 +0200
commitf608e7801634f0ac9b661a22033be06ab5f5180b (patch)
treeab97340df6e02ce7b23f4da86462a2d86578bd46
parentb7b6f4c557c7306c1aab56a3fb6632aa7b88de8d (diff)
downloadffmpeg-f608e7801634f0ac9b661a22033be06ab5f5180b.tar.gz
avformat/nistspheredec: Check bps
Fixes: left shift of 1111111190 by 3 places cannot be represented in type 'int' Fixes: 26437/clusterfuzz-testcase-minimized-ffmpeg_dem_NISTSPHERE_fuzzer-4886896091856896 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 7c144b363e67bef7651108c88687b38155172c1f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/nistspheredec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/nistspheredec.c b/libavformat/nistspheredec.c
index 55f22ebcf4..dbf031f3e3 100644
--- a/libavformat/nistspheredec.c
+++ b/libavformat/nistspheredec.c
@@ -109,6 +109,8 @@ static int nist_read_header(AVFormatContext *s)
sscanf(buffer, "%*s %*s %"SCNd64, &st->duration);
} else if (!memcmp(buffer, "sample_n_bytes", 14)) {
sscanf(buffer, "%*s %*s %d", &bps);
+ if (bps > INT_MAX/8U)
+ return AVERROR_INVALIDDATA;
} else if (!memcmp(buffer, "sample_rate", 11)) {
sscanf(buffer, "%*s %*s %d", &st->codecpar->sample_rate);
} else if (!memcmp(buffer, "sample_sig_bits", 15)) {