From 5e7c828c9e2007ded6baf161bcbc5430e95002af 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 27ee376828256..8c3e16bb82866 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -136,7 +136,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;