[FFmpeg-cvslog] tools/target_dec_fuzzer: Only audio uses the return value to decode packets in pieces, correct the code to match that

Michael Niedermayer git at videolan.org
Wed Feb 1 00:44:28 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Jan 31 22:26:01 2017 +0100| [8bdba1092f50d52e0af90f425811302ec91152f8] | committer: Michael Niedermayer

tools/target_dec_fuzzer: Only audio uses the return value to decode packets in pieces, correct the code to match that

Fixes: Timeout
Fixes: 483/fuzz-0-ffmpeg_VIDEO_AV_CODEC_ID_H263I_fuzzer

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 tools/target_dec_fuzzer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 533aa37..8761d96 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -186,6 +186,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
 
             if (ret <= 0 || ret > avpkt.size)
                break;
+            if (ctx->codec_type != AVMEDIA_TYPE_AUDIO)
+                ret = avpkt.size;
             avpkt.data += ret;
             avpkt.size -= ret;
         }



More information about the ffmpeg-cvslog mailing list