diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-25 20:07:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-16 01:05:27 +0200 |
commit | c419022789030b87d3558cae65ff33786b69a983 (patch) | |
tree | 59d91775e7665788f951eeae35f01eca021020ba | |
parent | 8cbe7461b364ef86c31ec56fd903aa6cb6d82c5f (diff) | |
download | ffmpeg-c419022789030b87d3558cae65ff33786b69a983.tar.gz |
avcodec/smc: Check remaining input
Fixes: Timeout
Fixes: 1818/clusterfuzz-testcase-minimized-5039166473633792
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 356194fcb17375de2472f4cbff6ede48d6a374b2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/smc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/smc.c b/libavcodec/smc.c index 69d78ad1d1..bb5f808da2 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -132,6 +132,10 @@ static void smc_decode_stream(SmcContext *s) row_ptr, image_size); return; } + if (bytestream2_get_bytes_left(&s->gb) < 1) { + av_log(s->avctx, AV_LOG_ERROR, "input too small\n"); + return; + } opcode = bytestream2_get_byte(&s->gb); switch (opcode & 0xF0) { |