static void __attribute__((constructor))
module_init(void)
{
- const char *filename;
+ const char *env_filename;
+ char icd_filepath[1024];
uint32_t count;
VkResult res;
PFN_vkEnumerateInstanceExtensionProperties enum_inst_exts;
/* Get env var for ICD path. */
- filename = getenv("VK_TIZEN_ICD");
- VK_CHECK(filename, return, "No ICD library given.\n");
+ env_filename = getenv("VK_TIZEN_ICD");
+ VK_CHECK(env_filename, return, "No ICD library given.\n");
dlerror();
+ strncpy(icd_filepath, env_filename, sizeof(icd_filepath));
+
/* Open ICD file. */
- icd.lib = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+ icd.lib = dlopen(icd_filepath, RTLD_LAZY | RTLD_LOCAL);
VK_CHECK(icd.lib, return, "dlopen() failed - %s\n", dlerror());
/* Retrieve our first entry point for vulkan symbols. */