[FFmpeg-cvslog] avcodec/smc: Check remaining input

Michael Niedermayer git at videolan.org
Fri Jun 2 03:07:54 EEST 2017


ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Thu May 25 20:07:49 2017 +0200| [a49743407bc6afcf982f10b01f19d2aa45b4320b] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 356194fcb17375de2472f4cbff6ede48d6a374b2)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a49743407bc6afcf982f10b01f19d2aa45b4320b
---

 libavcodec/smc.c | 4 ++++
 1 file changed, 4 insertions(+)

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) {



More information about the ffmpeg-cvslog mailing list