mirror of
https://gitee.com/openharmony/msdp_device_status
synced 2025-02-17 06:08:13 +00:00
Fix check of pixelMap
Signed-off-by: wuliangdong <wuliangdong1@huawei.com> Change-Id: Ib5fbdd96774aaf164a4f15d4ea3f93eb8fb6bda7
This commit is contained in:
parent
9e182b9eea
commit
b998b6de21
@ -487,6 +487,7 @@ void InteractionManagerTest::PrintDragData(const DragData &dragData)
|
||||
{
|
||||
CALL_DEBUG_ENTER;
|
||||
for (const auto &shadowInfo : dragData.shadowInfos) {
|
||||
CHKPV(shadowInfo.pixelMap);
|
||||
FI_HILOGD("PixelFormat:%{public}d, PixelAlphaType:%{public}d, PixelAllocatorType:%{public}d,"
|
||||
" PixelWidth:%{public}d, PixelHeight:%{public}d, shadowX:%{public}d, shadowY:%{public}d",
|
||||
static_cast<int32_t>(shadowInfo.pixelMap->GetPixelFormat()),
|
||||
|
@ -433,6 +433,7 @@ int32_t DeviceStatusSrvStub::StartDragStub(MessageParcel& data, MessageParcel& r
|
||||
return E_DEVICESTATUS_READ_PARCEL_ERROR;
|
||||
}
|
||||
for (const auto& shadowInfo : dragData.shadowInfos) {
|
||||
CHKPR(shadowInfo.pixelMap, RET_ERR);
|
||||
if ((shadowInfo.x > 0) || (shadowInfo.y > 0) ||
|
||||
(shadowInfo.x < -shadowInfo.pixelMap->GetWidth()) || (shadowInfo.y < -shadowInfo.pixelMap->GetHeight())) {
|
||||
FI_HILOGE("Invalid parameter, shadowInfox:%{public}d, shadowInfoy:%{public}d", shadowInfo.x, shadowInfo.y);
|
||||
@ -551,6 +552,7 @@ int32_t DeviceStatusSrvStub::UpdateShadowPicStub(MessageParcel& data, MessagePar
|
||||
shadowInfo.pixelMap = std::shared_ptr<OHOS::Media::PixelMap>(pixelMap);
|
||||
READINT32(data, shadowInfo.x, E_DEVICESTATUS_READ_PARCEL_ERROR);
|
||||
READINT32(data, shadowInfo.y, E_DEVICESTATUS_READ_PARCEL_ERROR);
|
||||
CHKPR(shadowInfo.pixelMap, RET_ERR);
|
||||
if ((shadowInfo.x > 0) || (shadowInfo.y > 0) ||
|
||||
(shadowInfo.x < -shadowInfo.pixelMap->GetWidth()) ||
|
||||
(shadowInfo.y < -shadowInfo.pixelMap->GetHeight())) {
|
||||
|
@ -125,6 +125,7 @@ void DragManager::PrintDragData(const DragData &dragData)
|
||||
{
|
||||
CALL_INFO_TRACE;
|
||||
for (const auto& shadowInfo : dragData.shadowInfos) {
|
||||
CHKPV(shadowInfo.pixelMap);
|
||||
FI_HILOGI("PixelFormat:%{public}d, PixelAlphaType:%{public}d, PixelAllocatorType:%{public}d,"
|
||||
" PixelWidth:%{public}d, PixelHeight:%{public}d, shadowX:%{public}d, shadowY:%{public}d",
|
||||
static_cast<int32_t>(shadowInfo.pixelMap->GetPixelFormat()),
|
||||
|
Loading…
x
Reference in New Issue
Block a user