mirror of https://github.com/mpv-player/mpv
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:
parent
a5f2816278
commit
1225bcbd41
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue