diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-17 14:53:54 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-17 14:53:54 +0000 |
commit | e25c68402b38ac01dc1ae196ae8a5265b773c5f2 (patch) | |
tree | 7551d6583eb06a336bc75e988cf82ac0e4bad82b /src | |
parent | 583a1e38503ebd57ba9bd39a3fabe89bead8e76c (diff) |
Canvas to handle null layer device.
http://codereview.appspot.com/4907045/
See also http://code.google.com/p/chromium/issues/detail?id=93000.
git-svn-id: http://skia.googlecode.com/svn/trunk@2130 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkCanvas.cpp | 4 | ||||
-rw-r--r-- | src/utils/win/SkIStream.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 823ce8f996..aa6fe72c58 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -711,6 +711,10 @@ int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SkDevice* device = this->createLayerDevice(config, ir.width(), ir.height(), isOpaque); + if (NULL == device) { + SkDebugf("Unable to create device for layer."); + return count; + } device->setOrigin(ir.fLeft, ir.fTop); DeviceCM* layer = SkNEW_ARGS(DeviceCM, (device, ir.fLeft, ir.fTop, paint)); diff --git a/src/utils/win/SkIStream.cpp b/src/utils/win/SkIStream.cpp index 79164e6a31..8c9e180b89 100644 --- a/src/utils/win/SkIStream.cpp +++ b/src/utils/win/SkIStream.cpp @@ -189,8 +189,8 @@ HRESULT STDMETHODCALLTYPE SkIStream::Seek(LARGE_INTEGER liDistanceToMove break; } - if (NULL != lpNewFilePointer) {
- lpNewFilePointer->QuadPart = this->fLocation.QuadPart;
+ if (NULL != lpNewFilePointer) { + lpNewFilePointer->QuadPart = this->fLocation.QuadPart; } return hr; } |