From 2360f3eb1161559e2c80f1fb20a653d6efc206ed Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 18 Apr 2019 17:53:32 +0200 Subject: [PATCH] fix: copy pixels in AddImageSkiaRepFromBuffer (#17843) (#17862) --- atom/common/api/atom_api_native_image.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index dcf3d7f48fbdd..07926a8a6aff4 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -137,7 +137,7 @@ bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image, SkBitmap bitmap; bitmap.allocN32Pixels(width, height, false); - bitmap.setPixels(const_cast(reinterpret_cast(data))); + bitmap.writePixels({info, data, bitmap.rowBytes()}); image->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor)); return true;