Commit 93fb9b3c authored by Jonathan Metzman's avatar Jonathan Metzman Committed by Commit Bot

[Windows][tts_platform_fuzzer] Call CoInitiliazeEx once before fuzzing

Call CoInitiliazeEx once before fuzzing so that CoCreateInstance
succeeds.

Change-Id: I6e6c1fed60da7967a2294b3d781c2d1bd468bbbb
Bug: 904877
Reviewed-on: https://chromium-review.googlesource.com/c/1342620Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Jonathan Metzman <metzman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609873}
parent 7c8b7618
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include <objbase.h>
#include "build/build_config.h"
#include "chrome/browser/speech/tts_platform.h" #include "chrome/browser/speech/tts_platform.h"
// Entry point for LibFuzzer. // Entry point for LibFuzzer.
...@@ -15,6 +18,14 @@ extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) { ...@@ -15,6 +18,14 @@ extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) {
params.rate = 1.0; params.rate = 1.0;
params.volume = 0.1; params.volume = 0.1;
#if defined(OS_WIN)
static bool initialized = false;
if (!initialized) {
initialized = true;
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
}
#endif
// First byte gives us the utterance ID. // First byte gives us the utterance ID.
size_t i = 0; size_t i = 0;
if (i < size) if (i < size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment