1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-16 20:27:23 +00:00
Commit Graph

13 Commits

Author SHA1 Message Date
Kacper Michajłow
25f441b740 fuzzer_set_property: ensure idle is enabled
It is used in play loop to check if playback ended cleanly. Don't allow
set_property to disable idle.
2024-08-04 21:33:36 +02:00
Kacper Michajłow
ed77616f29 fuzzer: stop player after 5 seconds of playback
Timeouts can happen with various conditions, big, slow to decode files
is one of them. Most of the time those timeouts are not really important
to "fix". While they may show some issues like we currently have with
audio EOF #14427 for ao-null-untimed. Most of the reports are completely
not important and we should focus on other topics.

Ignore the timeouts during file playback, note that this will still
report any timeouts that happen in other conditions.

5 seconds of playback should cover most of interesting mpv code, even
for strange samples.

This will likely be reverted at some point in the future, but let first
stabilize the OSS-Fuzz, without dozens of bogus timeouts.
2024-07-17 22:17:52 +02:00
Kacper Michajłow
3cc42083aa fuzzer_set_property: reset sstep to 0 to avoid seeking loop
It would seek and keep player open. Not interesting to change this
behaviour, so just skip it for fuzzers.
2024-07-16 22:59:23 +02:00
Kacper Michajłow
09b25771e8 fuzzer_set_property: set duration to 0.1s
It looks like it is faster than 0.01s.
2024-07-11 21:55:21 +02:00
Kacper Michajłow
4574644b7a fuzzers: wait for file start event before idle
Sometimes we exited too soon, not waiting for full transition to idle
state.
2024-06-27 02:57:22 +02:00
Kacper Michajłow
5995f13b5f fuzzer_set_property: fix setting audio-files list
`:` were not escaped correctly. Also while at it clear other external
file lists, as we don't want to load any. Subtitle fuzzer will be added
in the future.

It is surprisingly hard to clear the list with C API. That needs whole
mpv_node_list with 0 elements, to make it clear it.
2024-06-26 01:28:55 +02:00
Kacper Michajłow
22ca65a59d fuzzer_set_property: destroy mpv also on error
Shouldn't matter much and in fact even LSAN doesn't complain, but we
should clean it correctly.

Fixes: 1225bcbd41
2024-06-24 17:36:53 +02:00
Kacper Michajłow
1225bcbd41 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.
2024-06-24 03:05:09 +02:00
Kacper Michajłow
ee2be6dc82 fuzzer_set_property: force untimed and pause state
We don't want to accidentally set those options and timeout in pause
state.

Remove video-osd as there is no reason to set it in fact.
2024-06-18 03:11:14 +02:00
Kacper Michajłow
e56054bc40 fuzzers: always return 0
While LibFuzzer supports rejecting unwanted inputs, it looks like
Honggfuzz treats anything other than 0 as fatal error.

https://llvm.org/docs/LibFuzzer.html#rejecting-unwanted-inputs
348a472139/libhfuzz/persistent.c (L67)
This LOG_F calls exit(EXIT_FAILURE)
2024-05-21 06:28:18 +02:00
Kacper Michajłow
c1d5f0e9c8 fuzzers: set network-timeout to 1 second
We don't expect any data to actually access, so timeout as soon as
possible.
2024-05-10 04:15:10 +02:00
Kacper Michajłow
49cb039b8c fuzzer_set_property: fix for other types than string
I tested with string version, oops.
2024-05-08 18:52:40 +02:00
Kacper Michajłow
47dbc3a74e fuzzers: add new fuzzer targets
fuzzer_set_property.c:

fuzz mpv_set_property in both initialized and non-initialized state.
Useful for user provided values sanitization test. I've already seen
some memory leaks in parsing code, good to drill it.

fuzzer_loadfile.c:

mpv_command "loadfile" test. Good for testing demuxers, decoding and
playback loop. Sadly in headless mode we can't really test AO and VO,
but at least all the code around can be fuzzed. Especially our custom
demuxers like demux_mkv.

fuzzer_loadfile_direct.c:

Similar to loadfile above, but instead of saving the data to file, it
passes the fuzz input in the command. Generated protocol specific
versions (mf:// and memory:// for now) and generic one.

Nothing really complex, but good start and even those few targets should
give good coverage of the most common code paths in libmpv.
2024-04-27 02:47:47 +02:00