aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2017-04-25 10:35:54 -0600
committerMark Young <marky@lunarg.com>2017-04-26 01:30:22 -0600
commit524d6a4ac0c2ed982242e68240d51dbbbdf42a35 (patch)
tree6c473855a7747370c872fa5be4b049a9d5c267d3
parent8697336f4790772ef1c423a2775b957e1a11b40c (diff)
downloadusermoji-524d6a4ac0c2ed982242e68240d51dbbbdf42a35.tar.xz
loader: gh1681 - Restrict error in JSON
Restrict the loader's JSON errors when reading ICD manifest files to only return an overall error if there are no valid drivers. Change-Id: I10edb1cdc7e4db9cfdc0b3595416f0614ed22867
-rw-r--r--loader/loader.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 634395ee..48e90647 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2762,18 +2762,24 @@ VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_t
continue;
}
- res = loader_get_json(inst, file_str, &json);
- if (NULL == json || res != VK_SUCCESS) {
+ VkResult temp_res = loader_get_json(inst, file_str, &json);
+ if (NULL == json || temp_res != VK_SUCCESS) {
if (NULL != json) {
cJSON_Delete(json);
json = NULL;
}
- if (res == VK_ERROR_OUT_OF_HOST_MEMORY) {
+ // If we haven't already found an ICD, copy this result to
+ // the returned result.
+ if (num_good_icds == 0) {
+ res = temp_res;
+ }
+ if (temp_res == VK_ERROR_OUT_OF_HOST_MEMORY) {
break;
} else {
continue;
}
}
+ res = temp_res;
cJSON *item, *itemICD;
item = cJSON_GetObjectItem(json, "file_format_version");