aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-17 22:52:59 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:53:29 +0200
commit9bb8a4f773ca65fe924863ddc539cd2a1c1fcfb7 (patch)
tree5d9d275825c1d224396dc32ceba0065c62c1f439 /libavformat
parentef8ece49acfa8ef5af56d712672d9804265f3efa (diff)
downloadffmpeg-9bb8a4f773ca65fe924863ddc539cd2a1c1fcfb7.tar.gz
avformat/soxdec: Check channels to be positive
Fixes: signed integer overflow: 32 * -1795162112 cannot be represented in type 'int' Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SOX_fuzzer-6724151473340416 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 b0588b73daeb0e6a0741f39b33943c67eac71619) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/soxdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c
index 12a94c8ffa..2801c3e239 100644
--- a/libavformat/soxdec.c
+++ b/libavformat/soxdec.c
@@ -90,7 +90,7 @@ static int sox_read_header(AVFormatContext *s)
sample_rate_frac);
if ((header_size + 4) & 7 || header_size < SOX_FIXED_HDR + comment_size
- || st->codecpar->channels > 65535) /* Reserve top 16 bits */ {
+ || st->codecpar->channels > 65535 || st->codecpar->channels <= 0) /* Reserve top 16 bits */ {
av_log(s, AV_LOG_ERROR, "invalid header\n");
return AVERROR_INVALIDDATA;
}