From 41ce18255979aee4b0f81e315b9ab6079166a909 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 18 Apr 2019 02:16:34 +0200 Subject: [PATCH] fix: copy pixels in AddImageSkiaRepFromBuffer (#17843) --- 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 84253ed5c93ba..b8c51e5b96232 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -135,7 +135,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;