blob: 07677743aef82f305baf88d809c866919ad10978 [file] [log] [blame]
Prashant Malani5539a0d2017-12-05 08:12:12 +00001// Copyright 2017 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include <stddef.h>
6#include <stdint.h>
7
Tom Anderson28774bc2018-03-21 14:46:26 +00008#include <memory>
9
Prashant Malani5539a0d2017-12-05 08:12:12 +000010#include "media/midi/midi_message_queue.h"
11
12extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
13 auto queue_running = std::make_unique<midi::MidiMessageQueue>(true);
14 auto queue_normal = std::make_unique<midi::MidiMessageQueue>(false);
15
16 queue_running->Add(data, size);
17 queue_normal->Add(data, size);
18
19 std::vector<uint8_t> message;
20 while (true) {
21 queue_running->Get(&message);
22 if (message.empty())
23 break;
24 }
25
26 while (true) {
27 queue_normal->Get(&message);
28 if (message.empty())
29 break;
30 }
31
32 return 0;
33}