aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-31 15:22:53 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-21 23:42:35 +0100
commit61620896a1acd80e00cb8821febe39efd3724978 (patch)
tree548522233da728887389caed291ffeeed992c75f
parent6b430f066b9d6637f145fe228e7950a03820a1ab (diff)
downloadffmpeg-61620896a1acd80e00cb8821febe39efd3724978.tar.gz
avcodec/qdm2: The smallest header seems to have 2 bytes so treat 1 as invalid
Fixes: Timeout (217sec -> 2ms) Fixes: 18488/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5708293662310400 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 e36ccb5048f052b8b2ef08281cb607fa53a7b7e4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/qdm2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index ac8ae8cbbb..7b9d50b234 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1704,7 +1704,7 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
s->group_size = bytestream2_get_be32(&gb);
s->fft_size = bytestream2_get_be32(&gb);
s->checksum_size = bytestream2_get_be32(&gb);
- if (s->checksum_size >= 1U << 28 || !s->checksum_size) {
+ if (s->checksum_size >= 1U << 28 || s->checksum_size <= 1) {
av_log(avctx, AV_LOG_ERROR, "data block size invalid (%u)\n", s->checksum_size);
return AVERROR_INVALIDDATA;
}