File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,11 @@ namespace dxvk {
99
99
const uint32_t extCount = extInfo.extensionNameList .count ();
100
100
pCreateInfo->ppEnabledExtensionNames = extCount > 0 ? new const char *[extCount] : nullptr ;
101
101
for (uint32_t i = 0 ; i < extCount; i++) {
102
- pCreateInfo->ppEnabledExtensionNames [i] = extInfo.extensionNameList .name (i);
102
+ const char * nameStr = extInfo.extensionNameList .name (i);
103
+ size_t nameLen = std::strlen (nameStr);
104
+ char * name = new char [nameLen + 1 ];
105
+ std::strncpy (name, nameStr, nameLen);
106
+ pCreateInfo->ppEnabledExtensionNames [i] = name;
103
107
}
104
108
pCreateInfo->info .ppEnabledExtensionNames = pCreateInfo->ppEnabledExtensionNames ;
105
109
pCreateInfo->info .enabledExtensionCount = extCount;
@@ -112,8 +116,15 @@ namespace dxvk {
112
116
D3D9VkDeviceCreateInfo* pCreateInfo) {
113
117
if (!pCreateInfo)
114
118
return ;
115
- if (pCreateInfo->ppEnabledExtensionNames != nullptr )
119
+
120
+ if (pCreateInfo->ppEnabledExtensionNames != nullptr ) {
121
+ for (uint32_t i = 0 ; i < pCreateInfo->info .enabledExtensionCount ; i++) {
122
+ delete pCreateInfo->ppEnabledExtensionNames [i];
123
+ }
124
+
116
125
delete[] pCreateInfo->ppEnabledExtensionNames ;
126
+ }
127
+
117
128
if (pCreateInfo->pQueueCreateInfos != nullptr )
118
129
delete[] pCreateInfo->pQueueCreateInfos ;
119
130
delete pCreateInfo;
You can’t perform that action at this time.
0 commit comments