aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-17 14:53:54 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-17 14:53:54 +0000
commite25c68402b38ac01dc1ae196ae8a5265b773c5f2 (patch)
tree7551d6583eb06a336bc75e988cf82ac0e4bad82b /src
parent583a1e38503ebd57ba9bd39a3fabe89bead8e76c (diff)
Canvas to handle null layer device.
Diffstat (limited to 'src')
-rw-r--r--src/core/SkCanvas.cpp4
-rw-r--r--src/utils/win/SkIStream.cpp4
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;
}