From 5129bb61d7d0fd321a4a007c8a509a22d5c4091f Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Wed, 27 Jan 2016 16:03:49 -0700 Subject: vktrace: fixes to allow vktrace/replay to work with Hologram - Protect strlen() against NULL strings - Avoid freeing remapped semaphores in replay QueuePresent before using them - Use a VkMemory total size instead of the literal VK_WHOLE_SIZE in trace buffers --- vk_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vk_helper.py b/vk_helper.py index fd5c96e0..ea0b8e71 100755 --- a/vk_helper.py +++ b/vk_helper.py @@ -1358,7 +1358,7 @@ class StructWrapperGen: sh_funcs.append('%sstructSize += pStruct->%s*sizeof(%s);' % (indent, self.struct_dict[s][m]['array_size'], self.struct_dict[s][m]['type'])) elif self.struct_dict[s][m]['ptr'] and 'pNext' != self.struct_dict[s][m]['name']: if 'char' in self.struct_dict[s][m]['type'].lower(): - sh_funcs.append('%sstructSize += sizeof(%s)*(1+strlen(pStruct->%s));' % (indent, self.struct_dict[s][m]['type'], self.struct_dict[s][m]['name'])) + sh_funcs.append('%sstructSize += (pStruct->%s != NULL) ? sizeof(%s)*(1+strlen(pStruct->%s)) : 0;' % (indent, self.struct_dict[s][m]['name'], self.struct_dict[s][m]['type'], self.struct_dict[s][m]['name'])) elif is_type(self.struct_dict[s][m]['type'], 'struct'): sh_funcs.append('%sstructSize += %s(pStruct->%s);' % (indent, self._get_size_helper_func_name(self.struct_dict[s][m]['type']), self.struct_dict[s][m]['name'])) elif 'void' not in self.struct_dict[s][m]['type'].lower(): -- cgit v1.2.3