This should make it much quicker for the fuzzer to test
real relevant codec_tags

Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 tools/target_dec_fuzzer.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index c6e1235ad3..b9e08f74d2 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -212,6 +212,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
         ctx->channels                           = 
(unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
         ctx->block_align                        = bytestream2_get_le32(&gbc) & 
0x7FFFFFFF;
         ctx->codec_tag                          = bytestream2_get_le32(&gbc);
+        if (c->codec_tags) {
+            int n;
+            for (n = 0; c->codec_tags[n] != CODEC_TAGS_END; n++);
+            ctx->codec_tag = c->codec_tags[ctx->codec_tag % n];
+        }
         keyframes                               = bytestream2_get_le64(&gbc);
         ctx->request_channel_layout             = bytestream2_get_le64(&gbc);
 
-- 
2.24.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to