summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-27 13:03:36 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-27 13:04:23 +0200
commit77d98898211eeb0241e8411428b0b364a6231744 (patch)
tree835f0304ae4b9f7864d553407e2a6b8facfd102d
parent1a36354698fc0453ba4d337786d2cb4d3e374cfb (diff)
downloadffmpeg-streaming-77d98898211eeb0241e8411428b0b364a6231744.zip
ffmpeg-streaming-77d98898211eeb0241e8411428b0b364a6231744.tar.gz
avcodec/pixlet: Fix runtime error: signed integer overflow: 2147483647 + 32 cannot be represented in type 'int'
Fixes: 1829/clusterfuzz-testcase-minimized-5527165321871360 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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
index 0dfd5ed..0e541a9 100644
--- a/libavcodec/pixlet.c
+++ b/libavcodec/pixlet.c
@@ -594,6 +594,10 @@ static int pixlet_decode_frame(AVCodecContext *avctx, void *data,
width = bytestream2_get_be32(&ctx->gb);
height = bytestream2_get_be32(&ctx->gb);
+ if ( width > INT_MAX - (1U << (NB_LEVELS + 1))
+ || height > INT_MAX - (1U << (NB_LEVELS + 1)))
+ return AVERROR_INVALIDDATA;
+
w = FFALIGN(width, 1 << (NB_LEVELS + 1));
h = FFALIGN(height, 1 << (NB_LEVELS + 1));
OpenPOWER on IntegriCloud