diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index e202e174d9a0c..4418975d107e8 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;