diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-12-05 19:23:04 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-02-19 13:27:02 +0100 |
commit | cd4ce3b862eacd0f2ccf9dadb5cb31776e599dd8 (patch) | |
tree | c153b92db17996ae0a5e7c937ea1b526f0eeb6ae /tools | |
parent | 0d34e21282b0a0f166cf97046fd35587afdc0515 (diff) | |
download | ffmpeg-cd4ce3b862eacd0f2ccf9dadb5cb31776e599dd8.tar.gz |
tools/target_dem_fuzzer: Test interrupt callback
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/target_dem_fuzzer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/target_dem_fuzzer.c b/tools/target_dem_fuzzer.c index 3c03c8d17c..6ee793a28b 100644 --- a/tools/target_dem_fuzzer.c +++ b/tools/target_dem_fuzzer.c @@ -34,6 +34,13 @@ typedef struct IOContext { int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); +int64_t interrupt_counter; +static int interrupt_cb(void *ctx) +{ + interrupt_counter --; + return interrupt_counter < 0; +} + static void error(const char *err) { fprintf(stderr, "%s", err); @@ -160,6 +167,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { *strchr(extension, ',') = 0; av_strlcatf(filename, sizeof(filename), ".%s", extension); } + + interrupt_counter = bytestream2_get_le32(&gbc); + avfmt->interrupt_callback.callback = interrupt_cb; } if (!io_buffer_size || size / io_buffer_size > maxblocks) |