diff --git a/fuzzers/fuzzer_load.c b/fuzzers/fuzzer_load.c index 4b3c1f2ff3..0024f5e6e8 100644 --- a/fuzzers/fuzzer_load.c +++ b/fuzzers/fuzzer_load.c @@ -81,9 +81,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) check_error(mpv_command(ctx, cmd)); #ifdef MPV_LOADFILE + bool loaded = false; while (1) { - mpv_event *event = mpv_wait_event(ctx, 10000); - if (event->event_id == MPV_EVENT_IDLE) + mpv_event *event = mpv_wait_event(ctx, -1); + if (event->event_id == MPV_EVENT_START_FILE) + loaded = true; + if (loaded && event->event_id == MPV_EVENT_IDLE) break; } #endif diff --git a/fuzzers/fuzzer_loadfile_direct.c b/fuzzers/fuzzer_loadfile_direct.c index c955f6449b..506670d9d4 100644 --- a/fuzzers/fuzzer_loadfile_direct.c +++ b/fuzzers/fuzzer_loadfile_direct.c @@ -75,9 +75,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) const char *cmd[] = {"loadfile", data, NULL}; check_error(mpv_command(ctx, cmd)); + bool loaded = false; while (1) { - mpv_event *event = mpv_wait_event(ctx, 10000); - if (event->event_id == MPV_EVENT_IDLE) + mpv_event *event = mpv_wait_event(ctx, -1); + if (event->event_id == MPV_EVENT_START_FILE) + loaded = true; + if (loaded && event->event_id == MPV_EVENT_IDLE) break; } diff --git a/fuzzers/fuzzer_set_property.c b/fuzzers/fuzzer_set_property.c index f8b00722c1..a8377837d1 100644 --- a/fuzzers/fuzzer_set_property.c +++ b/fuzzers/fuzzer_set_property.c @@ -104,9 +104,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) const char *cmd[] = {"loadfile", "av://lavfi:yuvtestsrc=d=0.01", NULL}; check_error(mpv_command(ctx, cmd)); + bool loaded = false; while (1) { - mpv_event *event = mpv_wait_event(ctx, 10000); - if (event->event_id == MPV_EVENT_IDLE) + mpv_event *event = mpv_wait_event(ctx, -1); + if (event->event_id == MPV_EVENT_START_FILE) + loaded = true; + if (loaded && event->event_id == MPV_EVENT_IDLE) break; } #endif