[host] d12: stop invalid pointer shape copies

This commit is contained in:
Geoffrey McRae
2026-08-24 13:24:21 +10:00
parent 4e75351c78
commit 0062db4eef
2 changed files with 17 additions and 4 deletions

View File

@@ -1613,9 +1613,13 @@ void d12_updatePointer(CapturePointer * pointer, void * shape, size_t shapeSize)
DEBUG_ERROR("Failed to obtain a buffer for the pointer shape");
pointer->shapeUpdate = false;
}
size_t copySize = min(dstSize, shapeSize);
memcpy(dst, shape, copySize);
else if (!shape || !shapeSize || shapeSize > dstSize)
{
DEBUG_ERROR("Pointer shape does not fit in the destination buffer");
pointer->shapeUpdate = false;
}
else
memcpy(dst, shape, shapeSize);
}
this->postPointerBufferFn(pointer);