diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-09 17:17:02 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-09 17:17:02 +0000 |
commit | feed0677b1f7f719498d3b08f0dab523a4c095e7 (patch) | |
tree | 19e7ae9b18a0c1657dbd786ca7082afe6c521f7c /skia | |
parent | c9ab7f105c3e5b6983970d432b0f78f8b40d3b86 (diff) | |
download | chromium_src-feed0677b1f7f719498d3b08f0dab523a4c095e7.zip chromium_src-feed0677b1f7f719498d3b08f0dab523a4c095e7.tar.gz chromium_src-feed0677b1f7f719498d3b08f0dab523a4c095e7.tar.bz2 |
Try to fix Crash at gfx::CGImageToSkBitmap.
The fix is to add the check for NULL context since skia::BitmapPlatformDevice::Create might return NULL.
BUG=54880
TEST=none
Review URL: http://codereview.chromium.org/3352014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58952 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/skia_utils_mac.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm index a913587..177004e 100644 --- a/skia/ext/skia_utils_mac.mm +++ b/skia/ext/skia_utils_mac.mm @@ -92,6 +92,8 @@ SkBitmap CGImageToSkBitmap(CGImageRef image) { scoped_ptr<skia::BitmapPlatformDevice> device( skia::BitmapPlatformDevice::Create(NULL, width, height, false)); + if (!device.get()) + return SkBitmap(); CGContextRef context = device->GetBitmapContext(); |