From 24af494e97069c6bb3c011f791b266fa8dffa273 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Fri, 12 Jul 2019 16:38:26 +0300 Subject: [PATCH] [HIP] Fix segfault on uninitialized struct members in hipArrayCreate and hipArray3DCreate [ROCm/clr commit: 299fbd4842a32023242a82cdd1a0470aee0d2580] --- projects/clr/hipamd/src/hip_memory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index aa63bd2c2a..2355772fd6 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -513,6 +513,8 @@ hipError_t hipArrayCreate(hipArray** array, const HIP_ARRAY_DESCRIPTOR* pAllocat array3D.NumChannels = pAllocateArray->NumChannels; array[0]->width = pAllocateArray->Width; array[0]->height = pAllocateArray->Height; + array[0]->Format = pAllocateArray->Format; + array[0]->NumChannels = pAllocateArray->NumChannels; array[0]->isDrv = true; array[0]->textureType = hipTextureType2D; void** ptr = &array[0]->data; @@ -705,6 +707,8 @@ hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAll array[0]->width = pAllocateArray->Width; array[0]->height = pAllocateArray->Height; array[0]->depth = pAllocateArray->Depth; + array[0]->Format = pAllocateArray->Format; + array[0]->NumChannels = pAllocateArray->NumChannels; array[0]->isDrv = true; array[0]->textureType = hipTextureType3D; void** ptr = &array[0]->data;