fuzzer_set_property: don't run mpv if set property failed

We can avoid testing this cases, hopefully there are no side-effects
when set property fails.
This commit is contained in:
Kacper Michajłow 2024-06-23 22:36:19 +02:00
parent a5f2816278
commit 1225bcbd41
1 changed files with 6 additions and 2 deletions

View File

@ -67,12 +67,16 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
check_error(mpv_initialize(ctx));
#endif
int ret;
if (MPV_FORMAT == MPV_FORMAT_STRING) {
mpv_set_property_string(ctx, name, (void *)data);
ret = mpv_set_property_string(ctx, name, (void *)data);
} else {
mpv_set_property(ctx, name, MPV_FORMAT, (void *)data);
ret = mpv_set_property(ctx, name, MPV_FORMAT, (void *)data);
}
if (ret != MPV_ERROR_SUCCESS)
return 0;
#if MPV_RUN
check_error(mpv_set_option_string(ctx, "ao-null-untimed", "yes"));
check_error(mpv_set_option_string(ctx, "untimed", "yes"));