mirror of
https://github.com/mpv-player/mpv
synced 2024-12-29 10:32:15 +00:00
47dbc3a74e
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.
27 lines
978 B
Meson
27 lines
978 B
Meson
incdir = include_directories('../')
|
|
|
|
executable('fuzzer_loadfile', 'fuzzer_loadfile.c',
|
|
include_directories: incdir, link_with: libmpv)
|
|
executable('fuzzer_loadfile_direct', 'fuzzer_loadfile_direct.c',
|
|
include_directories: incdir, link_with: libmpv)
|
|
|
|
foreach p : ['bd', 'cdda', 'dvb', 'dvd', 'edl', 'file', 'hex', 'lavf', 'memory',
|
|
'mf', 'slice', 'smb']
|
|
executable('fuzzer_protocol_' + p,
|
|
'fuzzer_loadfile_direct.c',
|
|
c_args: ['-DMPV_PROTO=' + p],
|
|
include_directories: incdir,
|
|
link_with: libmpv)
|
|
endforeach
|
|
|
|
|
|
foreach f : ['MPV_FORMAT_STRING', 'MPV_FORMAT_FLAG', 'MPV_FORMAT_INT64', 'MPV_FORMAT_DOUBLE']
|
|
foreach i : ['0', '1']
|
|
executable('fuzzer_set_property_' + f + '_' + i,
|
|
'fuzzer_set_property.c',
|
|
c_args: ['-DMPV_FORMAT=' + f, '-DMPV_RUN=' + i],
|
|
include_directories: incdir,
|
|
link_with: libmpv)
|
|
endforeach
|
|
endforeach
|