Browse Source

fuzzer: test env variable ESPEAK_DATA_PATH

before overwriting it with a default value for oss-fuzz
master
Philippe Antoine 4 years ago
parent
commit
956dd18202
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      tests/ssml-fuzzer.c

+ 4
- 1
tests/ssml-fuzzer.c View File

@@ -51,7 +51,10 @@ extern int LLVMFuzzerInitialize(const int* argc, char*** argv)

extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (!initialized) {
setenv("ESPEAK_DATA_PATH",filepath,0);
const char *hasDataPath = getenv("ESPEAK_DATA_PATH");
if (!hasDataPath) {
setenv("ESPEAK_DATA_PATH",filepath,0);
}
espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 0, NULL, 0);
espeak_SetSynthCallback(SynthCallback);
initialized = 1;

Loading…
Cancel
Save