Skip to content

Commit 1629b3b

Browse files
Stop layers with an invalid "type" field from being added
Layers without a valid 'type' field should be ignored, which wasn't occurring.
1 parent 8b1274b commit 1629b3b

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

loader/loader.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,6 +2768,7 @@ VkResult loader_read_layer_json(const struct loader_instance *inst, struct loade
27682768
loader_log(inst, VULKAN_LOADER_WARN_BIT, 0,
27692769
"Layer located at %s didn't find required layer value \"type\" in manifest JSON file, skipping this layer",
27702770
filename);
2771+
result = VK_ERROR_INITIALIZATION_FAILED;
27712772
goto out;
27722773
}
27732774

tests/framework/shim/unix_shim.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,19 @@ FRAMEWORK_EXPORT FILE* FOPEN_FUNC_NAME(const char* in_filename, const char* mode
282282

283283
// Fuzz tests have sub files embedded in the input data file. This
284284
if (!platform_shim.fuzz_data.empty() && out_file == NULL) {
285-
fprintf(stderr, "create_callback_file: Creating file %s\n", in_filename);
286-
FILE* fp = fopen(in_filename, "wb");
285+
FILE* fp = fopen(path.c_str(), "wb");
287286
if (nullptr == fp) {
288-
abort();
287+
path.replace_filename("callback_file_" + std::to_string(platform_shim.temp_fuzz_files.size()));
288+
fp = fopen(path.c_str(), "wb");
289+
if (nullptr == fp) {
290+
abort();
291+
}
289292
}
290293
fwrite(platform_shim.fuzz_data.data(), platform_shim.fuzz_data.size(), 1, fp);
291294
fclose(fp);
292-
platform_shim.temp_fuzz_files.emplace_back(in_filename);
295+
platform_shim.temp_fuzz_files.emplace_back(path.c_str());
293296

294-
out_file = fopen(in_filename, "rb");
297+
out_file = fopen(path.c_str(), "rb");
295298
}
296299
return out_file;
297300
}

0 commit comments

Comments
 (0)