Use memcpy_s instead of memcpy

Change-Id: I14ae0f782f38f21fa5a1ce1fd7125e97065b5a61
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2020-04-30 14:43:25 +02:00
committed by sys_ocldev
parent 2caeb739c3
commit bc09c95a17

View File

@@ -1098,7 +1098,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendBlitFill(void *ptr,
auto internalAlloc = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
size_t offset = 0;
for (uint32_t i = 0; i < size / patternSize; i++) {
memcpy(ptrOffset(internalAlloc->getDriverAllocatedCpuPtr(), offset), pattern, patternSize);
memcpy_s(ptrOffset(internalAlloc->getDriverAllocatedCpuPtr(), offset), (internalAlloc->getUnderlyingBufferSize() - offset), pattern, patternSize);
offset += patternSize;
}
auto ret = appendMemoryCopy(ptr, internalAlloc->getDriverAllocatedCpuPtr(), size, hEvent, 0, nullptr);
@@ -1113,7 +1113,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendBlitFill(void *ptr,
}
commandContainer.addToResidencyContainer(allocData->gpuAllocation);
uint32_t patternToCommand[4] = {};
memcpy(&patternToCommand, pattern, patternSize);
memcpy_s(&patternToCommand, sizeof(patternToCommand), pattern, patternSize);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(allocData->gpuAllocation, patternToCommand, patternSize, *commandContainer.getCommandStream(), size, *device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]);
if (hEvent) {
this->appendSignalEventPostWalker(hEvent);