diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-04-19 16:46:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-09 13:54:52 +0200 |
commit | f2685c9ec30b25a5e1618de0d0698fc3a33ffabc (patch) | |
tree | c834ceae0cad45654260c1419c5af9f3019ef11e | |
parent | 9ce7856341294dae8940ce44157a044d87f468f3 (diff) | |
download | ffmpeg-f2685c9ec30b25a5e1618de0d0698fc3a33ffabc.tar.gz |
avcodec/clearvideo: Check for 0 tile_shift
Fixes: shift exponent -1 is negative
Fixes: 33401/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-5908683596890112
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 63e75e09aef5836330a2786f0a9229ed82239e6b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/clearvideo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 26cdfb2731..551867bc11 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -665,8 +665,8 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) } c->tile_shift = av_log2(c->tile_size); - if (1U << c->tile_shift != c->tile_size) { - av_log(avctx, AV_LOG_ERROR, "Tile size: %d, is not power of 2.\n", c->tile_size); + if (1U << c->tile_shift != c->tile_size || c->tile_shift < 1) { + av_log(avctx, AV_LOG_ERROR, "Tile size: %d, is not power of 2 > 1\n", c->tile_size); return AVERROR_INVALIDDATA; } |