projects
/
platform
/
framework
/
web
/
crosswalk-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a47e30d
)
Fix crash in ReadImageSkiaFromICO when CreateSkBitmapFromHICON fails
author
Milan Burda
<milan.burda@gmail.com>
Mon, 27 Jun 2016 12:38:12 +0000
(14:38 +0200)
committer
Kevin Sawicki
<kevinsawicki@gmail.com>
Tue, 28 Jun 2016 19:17:05 +0000
(12:17 -0700)
atom/common/api/atom_api_native_image.cc
patch
|
blob
|
history
diff --git
a/atom/common/api/atom_api_native_image.cc
b/atom/common/api/atom_api_native_image.cc
index
b666f86
..
1450049
100644
(file)
--- a/
atom/common/api/atom_api_native_image.cc
+++ b/
atom/common/api/atom_api_native_image.cc
@@
-160,10
+160,14
@@
base::win::ScopedHICON ReadICOFromPath(int size, const base::FilePath& path) {
LR_LOADFROMFILE)));
}
-
void
ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) {
+
bool
ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) {
// Convert the icon from the Windows specific HICON to gfx::ImageSkia.
std::unique_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon));
+ if (!bitmap)
+ return false;
+
image->AddRepresentation(gfx::ImageSkiaRep(*bitmap, 1.0f));
+ return true;
}
#endif