diff --git a/camera/interfaces/hdi_ipc/client/src/stream_operator_proxy.cpp b/camera/interfaces/hdi_ipc/client/src/stream_operator_proxy.cpp index 6427d3b3802ce5ecd1611096b3dfcc78438f7f27..3e99d28878f320cfd7a5e9733a4c0e35334212cf 100644 --- a/camera/interfaces/hdi_ipc/client/src/stream_operator_proxy.cpp +++ b/camera/interfaces/hdi_ipc/client/src/stream_operator_proxy.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "istream_operator_callback.h" #include "ioffline_stream_operator.h" #include "camera_metadata_info.h" @@ -207,10 +208,10 @@ CamRetCode StreamOperatorProxy::GetStreamAttributes( int32_t count = reply.ReadInt32(); for (int i = 0; i < count; i++) { const uint8_t *buffer = data.ReadBuffer(sizeof(StreamAttribute)); - std::shared_ptr attribute = - std::shared_ptr( - reinterpret_cast( - const_cast(buffer))); + std::shared_ptr attribute = std::make_shared(); + if (memcpy_s(attribute.get(), sizeof(StreamAttribute), buffer, sizeof(StreamAttribute)) != EOK) { + return INVALID_ARGUMENT; + } attributes.push_back(attribute); }