diff mbox series

[FFmpeg-devel,6/7] tools/target_dec_fuzzer: Fuzz FF_DEBUG_*

Message ID 20200207134831.23137-6-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/7] tools/target_dec_fuzzer: Fuzz skip_frame
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Michael Niedermayer Feb. 7, 2020, 1:48 p.m. UTC
This should increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 tools/target_dec_fuzzer.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 7e73c83686..dcf9e06121 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -191,6 +191,8 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         GetByteContext gbc;
         int extradata_size;
         int flags;
+        int64_t flags64;
+
         size -= 1024;
         bytestream2_init(&gbc, data + size, 1024);
         ctx->width                              = bytestream2_get_le32(&gbc);
@@ -246,6 +248,13 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
             }
         }
 
+        flags64 = bytestream2_get_le64(&gbc);
+        if (flags64 &1)
+            ctx->debug |= FF_DEBUG_SKIP;
+        if (flags64 &2)
+            ctx->debug |= FF_DEBUG_QP;
+        if (flags64 &4)
+            ctx->debug |= FF_DEBUG_MB_TYPE;
 
         if (extradata_size < size) {
             ctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);