diff mbox series

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

Message ID 20200207134831.23137-3-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 is needed for fuzzing tiff/tdsc and should increase coverage

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

Comments

Michael Niedermayer June 8, 2020, 6:41 p.m. UTC | #1
On Fri, Feb 07, 2020 at 02:48:27PM +0100, Michael Niedermayer wrote:
> This is needed for fuzzing tiff/tdsc and should increase coverage
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/allcodecs.c    | 1 +
>  tools/target_dec_fuzzer.c | 6 ++++++
>  2 files changed, 7 insertions(+)

will apply

[...]
diff mbox series

Patch

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();