aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/smc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-25 20:07:49 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-25 20:08:31 +0200
commit356194fcb17375de2472f4cbff6ede48d6a374b2 (patch)
treecb538b982ef5b85b08f59481892c636205b09216 /libavcodec/smc.c
parentb946bd8ef2c7aeee09469a4901182a44f9b67189 (diff)
downloadffmpeg-356194fcb17375de2472f4cbff6ede48d6a374b2.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>
Diffstat (limited to 'libavcodec/smc.c')
-rw-r--r--libavcodec/smc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index 89524219f8..79f9a757a0 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) {