diff mbox series

[FFmpeg-devel,4/7] tools/target_dec_fuzzer: Set extradata for the parser

Message ID 20200207134831.23137-4-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 improve coverage

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

Patch

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 2e718c2e95..f1768d4dce 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -266,6 +266,9 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         return 0; // Failure of avcodec_open2() does not imply that a issue was found
     }
     parser_avctx->codec_id = ctx->codec_id;
+    parser_avctx->extradata_size = ctx->extradata_size;
+    parser_avctx->extradata      = av_memdup(ctx->extradata, ctx->extradata_size);
+
 
     int got_frame;
     AVFrame *frame = av_frame_alloc();