0

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
This commit is contained in:
caryclark@google.com
2011-10-06 22:09:27 +00:00
parent e32b7f5f07
commit 49059b58d2

@ -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(