OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
| 9 #include "base/logging.h" |
9 #include "media/cdm/cenc_utils.h" | 10 #include "media/cdm/cenc_utils.h" |
10 | 11 |
| 12 struct Environment { |
| 13 Environment() { |
| 14 // Disable noisy logging as per "libFuzzer in Chrome" documentation: |
| 15 // testing/libfuzzer/getting_started.md#Disable-noisy-error-message-logging. |
| 16 logging::SetMinLogLevel(logging::LOG_FATAL); |
| 17 } |
| 18 }; |
| 19 |
| 20 Environment* env = new Environment(); |
| 21 |
11 // Entry point for LibFuzzer. | 22 // Entry point for LibFuzzer. |
12 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | 23 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
13 std::vector<uint8_t> input(data, data + size); | 24 std::vector<uint8_t> input(data, data + size); |
14 media::ValidatePsshInput(input); | 25 media::ValidatePsshInput(input); |
15 return 0; | 26 return 0; |
16 } | 27 } |
OLD | NEW |