diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-05-01 00:20:40 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-07-12 21:55:22 +0200 |
commit | 4f9ee4bf43623ff0960d3d8cf2025c2cdb54382a (patch) | |
tree | 967c9f2de5df066860b5fb77d17ab3c59d9dd698 | |
parent | dd6040675ec18d19429f882caea6bb306ed6677a (diff) | |
download | ffmpeg-4f9ee4bf43623ff0960d3d8cf2025c2cdb54382a.tar.gz |
avcodec/pixlet: consider minimum plane header in the minimal packet size
Fixes: Timeout
Fixes: 46956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PIXLET_fuzzer-5698161106092032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/pixlet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index 3174f30e91..4f9282bb94 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -611,7 +611,7 @@ static int pixlet_decode_frame(AVCodecContext *avctx, AVFrame *p, bytestream2_init(&ctx->gb, avpkt->data, avpkt->size); pktsize = bytestream2_get_be32(&ctx->gb); - if (pktsize <= 44 || pktsize - 4 > bytestream2_get_bytes_left(&ctx->gb)) { + if (pktsize <= 44 + (NB_LEVELS * 8 + 6) * 3 || pktsize - 4 > bytestream2_get_bytes_left(&ctx->gb)) { av_log(avctx, AV_LOG_ERROR, "Invalid packet size %"PRIu32"\n", pktsize); return AVERROR_INVALIDDATA; } |