[FFmpeg-devel] [PATCH 3/7] tools/target_dec_fuzzer: enable mjpeg for tiff or tdsc

Michael Niedermayer michael at niedermayer.cc
Fri Feb 7 15:48:27 EET 2020


This is needed for fuzzing tiff/tdsc and should increase coverage

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/allcodecs.c    | 1 +
 tools/target_dec_fuzzer.c | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0ad3338f9a..5735864702 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -795,6 +795,7 @@ extern AVCodec ff_vp9_qsv_encoder;
 // The iterate API is not usable with ossfuzz due to the excessive size of binaries created
 #if CONFIG_OSSFUZZ
 AVCodec * codec_list[] = {
+    NULL,
     NULL,
     NULL
 };
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 67a2a41874..2e718c2e95 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -120,6 +120,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         codec_list[0] = &DECODER_SYMBOL(FFMPEG_DECODER);
         avcodec_register(&DECODER_SYMBOL(FFMPEG_DECODER));
 
+#if FFMPEG_DECODER == tiff || FFMPEG_DECODER == tdsc
+        extern AVCodec DECODER_SYMBOL(mjpeg);
+        codec_list[1] = &DECODER_SYMBOL(mjpeg);
+        avcodec_register(&DECODER_SYMBOL(mjpeg));
+#endif
+
         c = &DECODER_SYMBOL(FFMPEG_DECODER);
 #else
         avcodec_register_all();
-- 
2.17.1



More information about the ffmpeg-devel mailing list