repair code issue

Signed-off-by: luwei <luwei51@huawei.com>
Change-Id: I8289d0c8d7900c10564799e092d064091900a842
This commit is contained in:
luwei
2022-03-30 20:59:05 +08:00
parent 46513c4db6
commit 41be3dfe1f
14 changed files with 90 additions and 76 deletions
+7 -1
View File
@@ -131,11 +131,17 @@ bool SurfaceReader::ProcessBuffer(const sptr<SurfaceBuffer> &buf)
errno_t ret = memcpy_s(data + width * i * BPP, width * BPP, addr + stride * i, width * BPP);
if (ret != EOK) {
WLOGFE("memcpy failed");
free(data);
return false;
}
}
sptr<PixelMap> pixelMap = new PixelMap();
sptr<PixelMap> pixelMap = new(std::nothrow) PixelMap();
if (pixelMap == nullptr) {
WLOGFE("create pixelMap failed");
return false;
}
ImageInfo info;
info.size.width = static_cast<int32_t>(width);
info.size.height = static_cast<int32_t>(height);