diff mbox

[FFmpeg-devel] avcodec: Disable new iterate API for ossfuzz

Message ID 20180514111401.6672-1-michael@niedermayer.cc
State Accepted
Commit 64f59a21b39b380eaadc6d5f5dc721965fb785e4
Headers show

Commit Message

Michael Niedermayer May 14, 2018, 11:14 a.m. UTC
A few days ago ossfuzz stoped testing new FFmpeg as it run out of diskspacee

https://oss-fuzz-build-logs.storage.googleapis.com/index.html

An alternative would be to revert the API.

This changes for example
-rwxr-x--- 1 michael michael 144803654 May 14 12:54 tools/target_dec_ac3_fixed_fuzzer*
to
-rwxr-x--- 1 michael michael  30333852 May 14 12:51 tools/target_dec_ac3_fixed_fuzzer*

Which should massively decrease space requirements

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

Comments

Michael Niedermayer May 15, 2018, 9:14 p.m. UTC | #1
On Mon, May 14, 2018 at 01:14:01PM +0200, Michael Niedermayer wrote:
> A few days ago ossfuzz stoped testing new FFmpeg as it run out of diskspacee
> 
> https://oss-fuzz-build-logs.storage.googleapis.com/index.html
> 
> An alternative would be to revert the API.
> 
> This changes for example
> -rwxr-x--- 1 michael michael 144803654 May 14 12:54 tools/target_dec_ac3_fixed_fuzzer*
> to
> -rwxr-x--- 1 michael michael  30333852 May 14 12:51 tools/target_dec_ac3_fixed_fuzzer*
> 
> Which should massively decrease space requirements
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/allcodecs.c    | 5 +++++
>  tools/target_dec_fuzzer.c | 6 ++++++
>  2 files changed, 11 insertions(+)

will apply so the fuzzer continues testing


[...]
diff mbox

Patch

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 102d99b7ea..7b7a8c71ff 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -760,7 +760,12 @@  extern AVCodec ff_vp9_cuvid_decoder;
 extern AVCodec ff_vp9_mediacodec_decoder;
 extern AVCodec ff_vp9_vaapi_encoder;
 
+// The iterate API is not usable with ossfuzz due to the excessive size of binaries created
+#if CONFIG_OSSFUZZ
+extern AVCodec * codec_list[];
+#else
 #include "libavcodec/codec_list.c"
+#endif
 
 static AVOnce av_codec_static_init = AV_ONCE_INIT;
 static void av_codec_init_static(void)
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 62d62a9de3..26a4cc2e89 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -56,6 +56,11 @@ 
 
 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
 
+AVCodec * codec_list[] = {
+    NULL,
+    NULL
+};
+
 static void error(const char *err)
 {
     fprintf(stderr, "%s", err);
@@ -144,6 +149,7 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
 #define DECODER_SYMBOL0(CODEC) ff_##CODEC##_decoder
 #define DECODER_SYMBOL(CODEC) DECODER_SYMBOL0(CODEC)
         extern AVCodec DECODER_SYMBOL(FFMPEG_DECODER);
+        codec_list[0] = &DECODER_SYMBOL(FFMPEG_DECODER);
         avcodec_register(&DECODER_SYMBOL(FFMPEG_DECODER));
 
         c = &DECODER_SYMBOL(FFMPEG_DECODER);