diff options
author | caryclark@google.com <caryclark@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-06 22:09:27 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-06 22:09:27 +0000 |
commit | 49059b58d2af3cb88132dbb918d7bec09a85be40 (patch) | |
tree | 7a6085fd6a4ffc596473f159845756c133015e23 /skia/ext | |
parent | e32b7f5f079248b597da6d99190753deff67d0f8 (diff) | |
download | chromium_src-49059b58d2af3cb88132dbb918d7bec09a85be40.zip chromium_src-49059b58d2af3cb88132dbb918d7bec09a85be40.tar.gz chromium_src-49059b58d2af3cb88132dbb918d7bec09a85be40.tar.bz2 |
Check for null context
https://bugs.webkit.org/show_bug.cgi?id=69149
describes a situation where running webkit tests
sporadically crashes in the Debug build.
The context returned by CGContextForData is NULL,
so an early return prevents the BitmapPlatformDevice
constructor from firing an assert in this case.
The callers already anticipate a NULL result, and
will propogate the error correctly.
BUG=WK69149
TEST=run webkit tests in a Debug build repeatedly
Review URL: http://codereview.chromium.org/8118014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext')
-rw-r--r-- | skia/ext/bitmap_platform_device_mac.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc index 15bf566..2c274c3 100644 --- a/skia/ext/bitmap_platform_device_mac.cc +++ b/skia/ext/bitmap_platform_device_mac.cc @@ -143,9 +143,11 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(CGContextRef context, } #endif - if (!context) + if (!context) { context = CGContextForData(data, width, height); - else + if (!context) + return NULL; + } else CGContextRetain(context); BitmapPlatformDevice* rv = new BitmapPlatformDevice( |