mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
tools/target_dem_fuzzer: Test interrupt callback
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0d34e21282
commit
cd4ce3b862
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user