FuzzCueParser.cxx 473 Bytes
Newer Older
1 2
#include "playlist/cue/CueParser.hxx"
#include "util/IterableSplitString.hxx"
3
#include "util/StringView.hxx"
4 5 6 7 8 9 10 11 12 13 14 15

extern "C" {
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
}

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
	CueParser parser;

	const std::string_view src{(const char *)data, size};

	for (const auto line : IterableSplitString(src, '\n')) {
16
		parser.Feed(line);
17 18 19 20 21 22 23 24
		parser.Get();
	}

	parser.Finish();
	parser.Get();

	return 0;
}