diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-06-24 01:01:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-02 19:41:48 +0100 |
commit | 76a60fc760bb189a94d2e941d6bc5dd5b34a6d2a (patch) | |
tree | 69e1935a280e9c816a20465c0a19deb2655cb62e /libavcodec | |
parent | 2a1e1bc0b59b6a91418fe7105667164752c3220c (diff) | |
download | ffmpeg-76a60fc760bb189a94d2e941d6bc5dd5b34a6d2a.tar.gz |
avcodec/qdm2: Check checksum_size for 0
Fixes: Infinite loop
Fixes: 15337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5757428949319680
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 7b2ebf89a411d957ca999f1e7a919ff617fbfd56)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/qdm2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 776a9e9f45..5ceec3420d 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1727,8 +1727,8 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) extradata += 4; s->checksum_size = AV_RB32(extradata); - if (s->checksum_size >= 1U << 28) { - av_log(avctx, AV_LOG_ERROR, "data block size too large (%u)\n", s->checksum_size); + if (s->checksum_size >= 1U << 28 || !s->checksum_size) { + av_log(avctx, AV_LOG_ERROR, "data block size invalid (%u)\n", s->checksum_size); return AVERROR_INVALIDDATA; } |